
public enum MyEnum { val1, val2, val3, val4 }
MyEnum Methods
Compiler |
Global |
Instance |
Description |
- |
- |
MyEnum() |
Constructor for the 'MyEnum' class to initialize with a MyEnum value |
| Returns a string representation of the MyEnum value ('val1', 'val2', ... ) | |||
| CompilerEnumIndex() | EnumIndex() | Index() | Returns the one based internal index for the enumeration value (val1=1,val2=2, val3=3,val4=4) |
| CompilerInc() | Inc() | Inc() | Increments the enumeration value based on internal index and returns new enum value |
| CompilerDec() | Dec() | Dec() | Decrements the enumeration value based on internal index and returns new enum value |
MyEnum Constants
| Constant Data Item | Data Type | Value |
| MyEnum.MaxValue | MyEnum | val4 |
| MyEnum.MinValue | MyEnum | val1 |
| MyEnum.NumValues | int | 4 |
Derived Classes
NONE
See Also
Class Hierarchy, Primitive Framework, int, float, string, bool
public method MyEnum(MyEnum InitValue = val1)
Parameters
InitValue
Initial value for the MyEnum object, with a default of val1 (first value in list)
Return Value
None
Description
This is the constructor for the 'MyEnum' class, invoked automatically by the VM during dynamic allocation of a MyEnum object or for initialization of local, global or shared data items, if a constructor was used in the data definition.
This constructor takes a MyEnum value as a parameter to initialize the object. A default of 'val1' is used if the parameter is not provided, which is the first value in the list.
MyEnum Class
public method<string> Str()
Parameters
None
Return Value
Returns the string representation of the MyEnum value
Description
This instance method returns the string representation of the internal MyEnum value. If the value is val1, the method returns "val1" and if val2, it returns "val2" and so on.
MyEnum Class
public method<string> EnumStr(MyEnum Value)
Parameters
Value
MyEnum value to be converted to a string
Return Value
Returns the string representation of the MyEnum value
Description
This global method returns the string representation of the MyEnum value. If the value is val1, the method returns "val1" and if val2, it returns "val2" and so on.
Global Method
public method<string> compiler CompilerEnumStr(MyEnum Value)
Parameters
Value
MyEnum value to be converted to a string
Return Value
Returns the string representation of the MyEnum value
Description
This compiler method returns the string representation of the MyEnum value. If the value is val1, the method returns "val1" and if val2, it returns "val2" and so on.
This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.
Compiler Method
public method<int> Index()
Parameters
None
Return Value
Returns the one based index of the MyEnum value
Description
This instance method returns the one based index of the internal MyEnum value. If the value is val1, the index is one, if val2, the index is two and so on. The max index is four and is associated with the last value in the list, val4
MyEnum Class
public method<int> EnumIndex(MyEnum Value)
Parameters
Value
MyEnum value to get index of
Return Value
Returns the one based index of the MyEnum value
Description
This global method returns the one based index of the internal MyEnum value. If the value is val1, the index is one, if val2, the index is two and so on. The max index is four and is associated with the last value in the list, val4
Global Method
public method<int> compiler CompilerEnumIndex(MyEnum Value)
Parameters
Value
MyEnum value to get index of
Return Value
Returns the one based index of the MyEnum value
Description
This global method returns the one based index of the internal MyEnum value. If the value is val1, the index is one, if val2, the index is two and so on. The max index is four and is associated with the last value in the list, val4.
This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.
Compiler Method
public method<MyEnum> Inc()
Parameters
None
Return Value
Returns the incremented MyEnum value
Description
This instance method increments the internal MyEnum value based on index and returns the result. If the internal bool value is val1, the incremented value becomes val2, and so on. If the MyEnum value is the highest value in the list (val4), the increment operation will cause an OverflowException to be fired.
This method modifies the internal MyEnumm object.
MyEnum Class
public method<MyEnum> Inc(MyEnum Value)
Parameters
Value
MyEnum value to be incremented
Return Value
Returns the incremented MyEnum value
Description
This global method increments the specified MyEnum value based on index and returns the result. If the MyEnum value is val1, the incremented value becomes val2, and so on. If the MyEnum value is the highest value in the list (val4), the increment operation will cause an OverflowException to be fired.
This method does not modify the source MyEnum object.
Global Method
public method<MyEnum> compiler CompilerInc(MyEnum ref Value)
Parameters
Value
Reference to MyEnum value to be incremented
Return Value
Returns the incremented MyEnum value
Description
This global method increments the specified MyEnum value based on index and returns the result. If the MyEnum value is val1, the incremented value becomes val2, and so on. If the MyEnum value is the highest value in the list (val4), the increment operation will not be performed and a value of true will be returned.
This method modifies the source bool object.
This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.
Compiler Method
public method<MyEnum> Dec()
Parameters
None
Return Value
Returns the decremented MyEnum value
Description
This instance method decrements the internal MyEnum value based on index and returns the result. If the MyEnum value is val4, the decremented value becomes val3, and so on. If the MyEnum value is already at the min value (first value in list), the decrement operation will cause an OverflowException to be fired.
This method modifies the internal MyEnum object.
MyEnum Class
public method<MyEnum> Dec(MyEnum Value)
Parameters
Value
MyEnum value to be decremented
Return Value
Returns the decremented MyEnum value
Description
This global method decrements the specified MyEnum value based on index and returns the result. If the MyEnum value is val4, the decremented value becomes val3, and so on. If the MyEnum value is already at the min value (first value in list), the decrement operation will cause an OverflowException to be fired.
This method does not modify the source MyEnum object.
Global Method
public method<MyEnum> compiler CompilerDec(MyEnum ref Value)
Parameters
Value
MyEnum value to be decremented
Return Value
Returns the decremented MyEnum value
Description
This global method decrements the specified MyEnum value based on index and returns the result. If the MyEnum value is val4, the decremented value becomes val3, and so on. If the MyEnum value is already at the min value (first value in list), the decrement operation will cause an OverflowException to be fired.
This method modifies the source MyEnum object.
This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.
Compiler Method