I have an Enum , Enums.State with many states likeCommand1,..2, 3 etc
I want to programatically change these values with a For loop.
How to send enum variables values from an Integer ?
Not sure if you've read through the help on this but assignment can only be done with enums of the same type: https://zone.ni.com/reference/en-XX/help/370052AA-01/tsfundamentals/infotopics/enumsastsexpressions/
However, you can use the SetValNumber and the coerce to enum flag:
Locals.MyEnum.SetValNumber("", 0x18, 1) where MyEnum is the enum and 1 is the numeric selection I want to make it. n 0x18 is the flag for coerce to enum:
Hope this helps,
I think Sam's answer should be marked as a solution. I'm just saying 😉