[edit]
I could draw heavily from your example above, but simplifying it a bit to be more accessible to any user:
Code: Select all
#include once "fbc-int/symbol.bi"
Function dataclassToStr( Byval classid As fbc.FB_DATACLASS ) as string
Static As Zstring Ptr classnames _
( fbc.FB_DATACLASS.FB_DATACLASS_INTEGER to fbc.FB_DATACLASS.FB_DATACLASS_UDT ) _
= { @"integer", @"float", @"string", @"udt" }
Select Case classid
Case Lbound(classnames) To Ubound(classnames)
Return *classnames(classid)
Case Else
Return "*invalid*"
End Select
End Function
#macro show_dataclass( sym )
Scope
Var classid = __FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.dataclass, sym )
Print Left( " [" & classid & "] " & dataclassToStr(classid) + Space(16), 16 ) & ": ";
Print #sym
End Scope
#endmacro
Dim As Byte b
Dim As Double d
Dim As String s
Type T
Dim As Long l
End Type
Dim As T t1
Print "EXAMPLES OF '__FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.dataclass, sym )':"
show_dataclass( b )
show_dataclass( d )
show_dataclass( s )
show_dataclass( T )
show_dataclass( T.l )
show_dataclass( t1 )
show_dataclass( t1.l )
Sleep
Code: Select all
EXAMPLES OF '__FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.dataclass, sym )':
[0] integer : b
[1] float : d
[2] string : s
[3] udt : T
[0] integer : T.l
[3] udt : t1
[0] integer : t1.l