FreeBASIC is a completely free, open-source, multi-platform BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, object orientation, unsigned data types, inline assembly, and many others.
I declared a function that takes and returns a constant:
Declare Function TestConstZStringPtr( _
ByVal key As Const ZString Ptr _
) As Const ZString Ptr
If you put the function inside the condition and pass Str(number), the code works:
If TestConstZStringPtr(Str(265)) Then
End If
If you pass Str(variable) and assign the function result to the variable, then the code works:
Dim Number As Integer = 0
Dim result As Const ZString Ptr = TestConstZStringPtr(Str(Number))
If you pass Str(variable) and put the function inside the condition, the code does not work:
' error 181: Invalid assignment/conversion, before 'Then' in 'If TestConstZStringPtr(Str(Number)) Then'
If TestConstZStringPtr(Str(Number)) Then
End If
I declared a function that takes and returns a constant:
If you put the function inside the condition and pass Str(number), the code works:
If you pass Str(variable) and assign the function result to the variable, then the code works:
If you pass Str(variable) and put the function inside the condition, the code does not work: