I used some OR statements in a Switch. Up to 5 OR's there was no problem, but then it mentioned that it was not unique anymore. If I put the last OR 32 I get an error message.
(translation: De waarde moet uniek zijn = the value should be unque)
What to do?
Kind regards
Jan
Use Or in Switch
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: Use Or in Switch
Hi Jan,
In the first case you are probably trying to check if the counter is 17 or 22 or 33. However, what Flowcode reads is you are trying to check if counter is:
So it compares your value to 55 (decimal).
When adding the 'OR 32' to the second case the value you are comparing to also becomes 55 so they are no longer unique.
If you want to compare all the different values you need to use a case (geval) for each value. Or use decision icons, not a switch.
Jac
In the first case you are probably trying to check if the counter is 17 or 22 or 33. However, what Flowcode reads is you are trying to check if counter is:
Code: Select all
dec bin
17 0001 0001
22 0001 0110
33 0010 0001
--------------------- OR
55 0011 0111
When adding the 'OR 32' to the second case the value you are comparing to also becomes 55 so they are no longer unique.
Code: Select all
dec bin
16 0001 0000
23 0001 0111
32 0010 0000
-------------------- OR
55 0011 0111
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis