
Unable To Create SAX Basic Classes & Modules
Help! I am unable to run examples of class and object modules taken from the
SAX BASIC help files. I emailed SAX, but got no reply Any suggestions would
be gratefully receieved. I have inclued two examples (straight out of the
help files with the error line commented. Thanks.
Brett Sheran
'A.BAS
'#Uses "File.CLS"
Sub Main
Dim File As New File
File.Attach "C:\AUTOEXEC.BAT"
Debug.Print File.ReadLine
End Sub
'File.CLS
'File|New Module|Class Module 'ERROR HERE 'Expecting Specific Object Type'
'Edit|Properties|Name=File
Option Explicit
Dim FN As Integer
Public Sub Attach(FileName As String)
FN = FreeFile
Open FileName For Input As #FN
End Sub
Public Sub Detach()
If FN <> 0 Then Close #FN
FN = 0
End Sub
Public Function ReadLine() As String
Line Input #FN,ReadLine
End Function
Private Sub Class_Initialize()
Debug.Print "Class_Initialize"
End Sub
Private Sub Class_Terminate()
Debug.Print "Class_Terminate"
Detach
End Sub
--------------------------------
'A.BAS
'#Uses "System.OBM"
Sub Main
Debug.Print Hex(System.Version) 'ERROR HERE: unexpected text
End Sub
'System.OBM
'File|New Module|Object Module
'Edit|Properties|Name=System
Option Explicit
Declare Function GetVersion16 Lib "Kernel" _
Alias "GetVersion" () As Long
Declare Function GetVersion32 Lib "Kernel32" _
Alias "GetVersion" () As Long
Public Function Version() As Long
If Win16 Then
Version = GetVersion16
Else
Version = GetVersion32
End If
End Function