Format enum with custom values

Forum Home Forums Understanding the Software Format enum with custom values

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17998
    oley
    Participant

    I have a command to enable/disable switch.
    The values are 0 and 0xFF00.
    Format enums start with a value of 0.
    Is it possible to define an enum with different values, like in C#?

    public enum SwitchState
    {
    Off = 0,
    On = 0xFF00
    }

    #17999
    manjey73
    Participant

    public double exsamp()
    {
    if (Cmd==0) return 0;
    elseif (Cmd==1) return 65 280;
    else return double.NaN;
    }

    there is no On or OFF in Cmd, numeric values are there, even if you use enumerations.

    #18000
    oley
    Participant

    Thanks, I thought about some script but want to ask if there is another option.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.