Can someone rip this code apart and tell me what stupid mistakes I have been making?
Code: Select all
Declare function test2 ( ByVal tt As String, ByVal Function ( ByVal As Any ptr)As Integer) As Integer
Declare Sub test1 (byval ts As String)
Dim text As String
text = "test good"
test2 text @test1
Sleep
End
Function test2 ( ByVal tt As String, ByVal Function ( ByVal As Any ptr)As Integer) As Integer
Print "This Is a test"
test1
Return -1
End Function
Sub test1( ByVal ts As String)
Print ts ; " callback "
End Sub
I get the following errors when I compile.
test.bas(3) error 59: Illegal specification, at parameter 2 (Function) of test2() in 'Declare function test2 ( ByVal tt As String, ByVal Function ( ByVal As Any ptr)As Integer) As Integer'
test.bas(11) error 42: Variable not declared, QCompare in 'QCompare text @test1'
test.bas(16) error 59: Illegal specification, at parameter 2 (Function) of test2() in 'Function test2 ( ByVal tt As String, ByVal Function ( ByVal As Any ptr)As Integer) As Integer'
test.bas(18) error 1: Argument count mismatch in 'test1'
test.bas(23) error 58: Type mismatch, at parameter 1 (ts) of test1() in 'Sub test1( ByVal ts As String)'