CLRInterop::parseClrEnum Method [AX 2012]
Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent CLRObject instance.
client server public static CLRObject parseClrEnum(str clrEnumTypeName, str enumValues)
Run On
CalledParameters
- clrEnumTypeName
- Type: str
The name of the type of CLR enumeration.
- enumValues
- Type: str
A string that contains the name or value to convert.
Return Value
Type: CLRObject ClassThe CLRObject instance that contains the specified CLR enumerator values.
The _enumValues parameter contains a value, a named constant, or a list of named constants that are delimited by commas (,). One or more blanks spaces can precede or follow each value, name, or comma in _enumValues. If _enumValues is a list, the return value is the value of the specified names combined with a bitwise OR operation.
The following example converts the enumerator value to the string value of Monday and prints the value in the Infolog.
static void Job6(Args _args)
{
System.DayOfWeek dayOfWeek;
System.Type dayOfWeekType;
dayOfWeek = CLRInterop::parseClrEnum( "System.DayOfWeek", "Monday");
dayOfWeekType = dayOfWeek.GetType();
info( dayOfWeek.ToString() );
}
Show: