hi all
how can I find more about these thinbasic commands "any" and "ptr" ??? the help manual is silent..
found it also last night in a freebasic script and have translated and changed / improved it for thinbasic'- testscript with "any" and "ptr" by lionheart
uses "console"
DECLARE SUB PrintFirstByte( x as any ptr ) '- ptr is not necessary
dim i,k as integer
dim z,v as string * 48
dim s as string
i = -1
k = -100
s = "hello World!"
z = "hello brave new World!"
v = "nothing is impossible with thinbasic!"
printl
PrintFirstByte i
printl
Printl s
Printl z
Printl v
printl
PrintFirstByte k
printl
waitkey
SUB PrintFirstByte( x as any )
printl x
printl k
END SUB
best regards, Lionheart
you can't always get what you want, but if you try sometimes you might find, you get what you need
Hi Frank,
any is a sort of wild card - any data type id accepted whether it's a dword or double or a UDT.
ptr means the address of the variable is passed - not the contents of the variable.
qualifying a parameter as byval .. as any ptr is a way of bypassing type checking.
Charles
Bookmarks