Hi I have a program which uses a Switch statement.
Based on the case chosen I want a variable to be set to allow one of two options either "one" or "zero".
I have tired to use an OR statement within the case but it hasn't worked (See below).
Does anyone know a way around this? At the moment it is only allowing one value which is "one" but I want it to allow either "one" or "Zero".
Thanks in advance.
Switch (PLCData)
{
Case "01"
Message ="one";
AllowedValue ="one" || AllowedValue ="zero";
break; Case "02"
}
VulpesPosted Jan 29, 2014, 6:18 PM
However, have you considered using a 'Flags' enum which enables you to combine alternative values?
// ...