Same as for me. It's not a big thing all of this, but just to be sure, this simplified code, does it work?kcvinu wrote:fb version is 1.05.0
Code: Select all
'------------------------------------------------------------------------------------------------------------------integer
function GetTypeOfVariable overload ( VariableParameter as integer ) as string
var returnTypeString => "integer"
'
return returnTypeString
end function
function GetTypeOfArray overload ( ArrayParameter() as integer ) as string
var returnTypeString => "integer"
'
return returnTypeString
end function
'------------------------------------------------------------------------------------------------------------------double
function GetTypeOfVariable overload ( VariableParameter as double ) as string
var returnTypeString => "double"
'
return returnTypeString
end function
function GetTypeOfArray overload ( ArrayParameter() as double ) as string
var returnTypeString => "double"
'
return returnTypeString
end function
'declare a variable
dim as integer i = 33
'get and print the variable's type
? "var type = "; GetTypeOfVariable( i )
'declare a dynamic array of null size
static as integer arrayOfInteger(2 to 8)
dim as double arrayOfDouble(-5 to 5)
'get and print the array's type
? "arr type = "; GetTypeOfArray( arrayOfInteger() )
? "arr type = "; GetTypeOfArray( arrayOfDouble() )
getKey()
'(eof)
Code: Select all
'_TYPE(UdtName) comes in replacement to the "type UdtName" syntax
#macro _TYPE( UdtName )
type UdtName
#endMacro
'_ENDTYPE(UdtName) comes in replacement to the "end type" combination of keywords closing the UDT definition block of "UdtName"
#macro _ENDTYPE( UdtName )
end type
function GetTypeOfVariable overload ( VariableParameter as UdtName ) as string
var returnTypeString => #UdtName
'
return returnTypeString
end function
function GetTypeOfArray overload ( ArrayParameter() as UdtName ) as string
var returnTypeString => #UdtName
'
return returnTypeString
end function
#endMacro
'declare a User Defined Type with the compatible macros as replacement for header
' compile with the switch -pp to see what code is rendered exactly after text replacement
_TYPE( UDTEXAMPLE )
as integer _dummy
_ENDTYPE( UDTEXAMPLE )
'declare a variable
dim as UDTEXAMPLE x
'get and print the variable's type
? "var type = "; GetTypeOfVariable( x )
'declare a dynamic array of null size
static as UDTEXAMPLE arrayOfUDTEXAMPLE1(2 to 8)
dim as UDTEXAMPLE arrayOfUDTEXAMPLE2(-5 to 5)
'get and print the array's type
? "arr type = "; GetTypeOfArray( arrayOfUDTEXAMPLE1() )
? "arr type = "; GetTypeOfArray( arrayOfUDTEXAMPLE2() )
getKey()
'(eof)