View Full Version : PixelShift
Footy
07-26-2012, 06:39 PM
Nevermind, figured it out
Brandon
07-26-2012, 06:58 PM
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
07-26-2012, 08:32 PM
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
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.