Object Module

Group

Declaration
Description
An object module implements an object.
  • Has a set of Publicprocedures accessible from other macros and modules.
  • These public symbols are accessed by way of the name of the object module or an object variable.
  • Public Consts, Types, arrays, fixed length strings are not allowed.
  • Has an optional Private Sub Object_Initialize which is called when an instance is created.
  • Has an optional Private Sub Object_Terminate which is called when an instance is destroyed.
  • An object module is similar to a class module except that one instance is automatically created. That instance has the same name as the object module's name.
  • To create additional instances use:
    Dim Obj As objectname
    Set Obj = New objectname
    
See Also
Class Module, Code Module, Uses, Object_Initialize, Object_Terminate

'A.WWB
'#Language "WWB-COM"
'#Uses "System.OBM"
Sub Main
    Debug.Print Hex(System.Version)
End Sub
 
'System.OBM
'File|New Module|Object Module
'Edit|Properties|Name=System
'#Language "WWB-COM"
Option Explicit
Declare Function GetVersion16 Lib "Kernel" _
    Alias "GetVersion" () As Long
Declare Function GetVersion Lib "Kernel32" () As PortInt
 
Public Function Version() As PortInt
    If Win16 Then
        Version = GetVersion16
    Else
        Version = GetVersion
    End If
End Function