ReneMiner
11-10-2014, 10:14
i have some strange bug...
Edit: seems I found a reason, Type_Exists does not return true for standard types?
old content moved to thinBasic support-area (http://www.thinbasic.com/community/project.php?issueid=473#note2769) .
I use this for something else now:
assume
uses "console"
Type t_Type
abcd As Function
efgh As Function
End Type
Function t_Type.abcd() As String
End Function
Function t_Type.efgh() As Long
End Function
Dim foo As t_Type
PrintL "Test 1 " & $CRLF
' no printout to await but surprise...
If foo.abcd() = "String" Then PrintL "foo.abcd returns string"
If foo.abcd() = "Long" Then PrintL "foo.abcd returns long"
If foo.efgh() = "String" Then PrintL "foo.efgh returns string"
If foo.efgh() = "Long" Then PrintL "foo.efgh returns long"
PrintL $CRLF & "Test 2 " & $CRLF
Select Case foo.abcd()
Case "String"
PrintL "foo.abcd contains string"
Case "Long"
PrintL "foo.abcd contains long"
End Select
Select Case foo.efgh()
Case "String"
PrintL "foo.efgh contains string"
Case "Long"
PrintL "foo.efgh contains long"
End Select
WaitKey
what's going on here?
Edit: seems I found a reason, Type_Exists does not return true for standard types?
old content moved to thinBasic support-area (http://www.thinbasic.com/community/project.php?issueid=473#note2769) .
I use this for something else now:
assume
uses "console"
Type t_Type
abcd As Function
efgh As Function
End Type
Function t_Type.abcd() As String
End Function
Function t_Type.efgh() As Long
End Function
Dim foo As t_Type
PrintL "Test 1 " & $CRLF
' no printout to await but surprise...
If foo.abcd() = "String" Then PrintL "foo.abcd returns string"
If foo.abcd() = "Long" Then PrintL "foo.abcd returns long"
If foo.efgh() = "String" Then PrintL "foo.efgh returns string"
If foo.efgh() = "Long" Then PrintL "foo.efgh returns long"
PrintL $CRLF & "Test 2 " & $CRLF
Select Case foo.abcd()
Case "String"
PrintL "foo.abcd contains string"
Case "Long"
PrintL "foo.abcd contains long"
End Select
Select Case foo.efgh()
Case "String"
PrintL "foo.efgh contains string"
Case "Long"
PrintL "foo.efgh contains long"
End Select
WaitKey
what's going on here?