Last active
December 18, 2015 18:19
-
-
Save andyhuey/5824996 to your computer and use it in GitHub Desktop.
Strange behavior from DictEnum class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void AjhDictEnumTest(Args _args) | |
| { | |
| // originally from http://arsalanax.blogspot.com/2012/02/get-values-of-base-enums-using-code-in.html | |
| EnumId enumId = enumNum(ActionType); | |
| DictEnum dictEnum = new DictEnum(enumId); | |
| int nElements = dictEnum.values(); | |
| int i; | |
| for (i=0; i < nElements; i++) | |
| { | |
| print dictEnum.index2Label(i); // this returns the label. | |
| print dictEnum.index2Name(i); // this also returns the label! | |
| print dictEnum.index2Symbol(i); // this returns the name. | |
| print dictEnum.index2Value(i); // this returns the number. | |
| } | |
| pause; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment