TypeOf() and array
Posted: Sun Jan 04, 2026 4:06 pm
TypeOf() cannot handle a plain array as argument.
For more details and the background why I want to use it, please see viewtopic.php?t=88114
Same issue probably with lists and maps.
Code: Select all
; PB 6.30 beta 5
EnableExplicit
Macro ShowType (_x_)
CompilerSelect TypeOf(_x_)
CompilerCase #PB_Ascii
Debug "Ascii"
CompilerCase #PB_Byte
Debug "Byte"
CompilerCase #PB_Character
Debug "Character"
CompilerCase #PB_Double
Debug "Double"
CompilerCase #PB_Float
Debug "Float"
CompilerCase #PB_Integer
Debug "Integer"
CompilerCase #PB_Long
Debug "Long"
CompilerCase #PB_Quad
Debug "Quad"
CompilerCase #PB_String
Debug "String"
CompilerCase #PB_Unicode
Debug "Unicode"
CompilerCase #PB_Word
Debug "Word"
CompilerDefault
Debug "unknown"
CompilerEndSelect
EndMacro
Dim a.i(5)
; ShowType(a) ; -> error
; ShowType(a()) ; -> error
; ShowType(a(0)) ; -> error
Same issue probably with lists and maps.