TypeOf(1) should return #pb_quad (because every numeric can be stored in quad)
TypeOf(1.1) should retrun #pb_double (because double can store float-values)
@"something" returns the address of the string, so this
@1 should return the address to a quad with the value 1 (like the string)
@1.1 should return the address to a double with the value 1.1
And maybe
Code: Select all
procedure.a proc()
endprocedure
debug TypeOf(proc())
Why?
Code: Select all
Structure vary
StructureUnion
a.a
b.b
c.c
d.d
f.f
i.i
l.l
w.w
q.q
EndStructureUnion
EndStructure
Procedure.q _test(t1,*v1.vary)
Protected ret.vary
If t1=#PB_Integer
ret\i=*v1\i
Debug "Integer!"+*v1\i
ElseIf t1=#PB_Double
ret\d=*v1\d
Debug "double!"+*v1\d
EndIf
ProcedureReturn ret\q
EndProcedure
Macro test(v1)
_test(TypeOf(v1),@v1)
EndMacro
a.i=11
b.d=20.5
Debug test(a)
Debug test(b)
debug test(99);<-compilererror