The special EnumToString function can be used to convert
an enum to a string. This function works in two different ways:
it can be used to convert an enum value to a string (in the example below
FIRST is converted to "FIRST"), or it can also be used to convert an
enum variable to a string (in the example below myenum is converted
to "SECOND").
enum MYENUM { FIRST, SECOND };
local MYENUM myenum = SECOND;
Printf( "FIRST ='%s'\n", EnumToString( FIRST ) );
Printf( "myenum='%s'\n", EnumToString( myenum ) );
The above code prints out the following results:
FIRST ='FIRST'
myenum='SECOND'
This function is especially useful in custom read functions which
need to return a string value.