SRL Archive - Help

PixelShift


Footy

2012-07-26 14:39:49

Nevermind, figured it out

Brandon

2012-07-26 14:58:26

That's because you haven't understood the binary-OR operator.. aka Logical-OR. If you don't understand it, I'm almost certain you will use Logical-AND/XOR wrong as well as they are both used the same way.

You can't do: 5 or 10 or 15 or 20
if you do, the result will be 31.

5 or 10 or 15 or 20 = 31.

You have to do:

if ((counter = 5) or (counter = 10) or (counter = 15) or (counter = 20)) then..

You do not need the extra brackets but it's there for distinguishing ambiguity.. The above is the same as:


if (counter = 5 or counter = 10 or counter = 15 or counter = 20) then..

but I have high standards and the brackets make it easier to read so I recommend using them.

Footy

2012-07-26 16:32:22

This is my first programming language, so I had no idea that equaled 31… Ill use your way instead, thanks!
E: got a type mismatch error when I tried it…
E: typed it like this to get it working
if (counter = 5) or (counter = 10) or (counter = 15) or (counter = 20) then