Group: Declaration
Description:
A class module
implements an ActiveX Automation object.
• Has a set of Public procedures accessible from other macros and modules.
• These public symbols are accessed via an object variable.
• Public Consts, Types, arrays, fixed length strings are not allowed.
• A class module is similar to a object module except that no instance is automatically created.
• To create an instance use:
Dim Obj As classname
See Also: Code Module, Object Module, Uses.
Example:
'A.WWB
'#Uses "File.CLS"
Sub Main
File.Attach "C:\AUTOEXEC.BAT"
'File.CLS
'File|New Module|Class Module
'Edit|Properties|Name=File
Option Explicit
Public Sub Attach(FileName As String)
FN = FreeFile
Open FileName For Input As #FN
FN = 0
Public Function ReadLine() As String
Private Sub Class_Initialize()
Debug.Print "Class_Initialize"
Detach