Otto,
I agree with 'Lumberjack' here: using Typeof() is better.
The usage of keywords as both a type and a number (which is what VO and Vulcan do) is really a nightmare. It should have been something like UsualType.LONG and UsualType.STRING.
Now if you want to keep using the old code, then I suggest you add a enum and compare with that.
In fact: inside the VulcanRTFuncs there is already an enum, but unfortunately is is internal.
With Reflector and the XSharp Plugin from Fabrice I could extract the following code for the Enum.
Please note that there are some holes in the list. This is on purpose. These types exist but are not supported as values inside a USUAL, such as for example DWORD (which is number 14).
INTERNAL ENUM UsualType AS Long
MEMBER @@NIL:=0
MEMBER INT:=1
MEMBER @@DATE:=2
MEMBER FLOAT:=3
MEMBER @@ARRAY:=5
MEMBER @@OBJECT:=6
MEMBER STRING:=7
MEMBER LOGIC:=8
MEMBER CODEBLOCK:=9
MEMBER SYMBOL:=10
MEMBER PSZ:=17
MEMBER @@PTR:=18
MEMBER INT64:=22
END ENUM
The numbers match the type numbers from VO that you can find in basetype.vh in the Cdsk\Include folder of your VO installation:
#define BT_VOID 0 // == NIL
#define BT_LONG 1 // signed long
#define BT_DATE 2 //
#define BT_FLOAT 3 // internal real format
#define BT_FIXED 4 // internal fixed format
#define BT_ARRAY 5 // array (ptr)
#define BT_OP 6 // object pointer
#define BT_STR 7 // string
#define BT_LOGIC 8
#define BT_CODE 9 // code block
#define BT_SYMBOL 10 // atom nr in symbol atom table
#define BT_BYTE 11 // byte
#define BT_INT 12 // signed int
#define BT_WORD 13 // word
#define BT_DWORD 14 // dword
#define BT_REAL4 15 // C float
#define BT_REAL8 16 // C double
#define BT_PSZ 17 // PSZ
#define BT_PTR 18 // raw ptr
#define BT_POLY 19 // polymorphic
#define BT_MAX BT_POLY
#define BT_LIMIT 20