IF statement question

in RobotStudio
Hello,
I am receiving a number from Sockets that gets placed into a variable "command". I am trying to test to see of that number is a certain number:
IF command<>42 OR command<>105 OR command<>106 OR command<>5 THEN
SocketSend clientSocket\Str:="Unknown command";
GOTO MainLoopEnd;
ENDIF
I am sending it the number 42, and it still goes into this IF statement. However, if I compare just IF command<>42 (not all the other OR command<>#'s), it works just fine and skips this loop.
So my question is, how can I compare multiple values? What am I doing wrong? Is there like a certain hierarchy thing I am missing?
Thanks for any help!
SM
I am receiving a number from Sockets that gets placed into a variable "command". I am trying to test to see of that number is a certain number:
IF command<>42 OR command<>105 OR command<>106 OR command<>5 THEN
SocketSend clientSocket\Str:="Unknown command";
GOTO MainLoopEnd;
ENDIF
I am sending it the number 42, and it still goes into this IF statement. However, if I compare just IF command<>42 (not all the other OR command<>#'s), it works just fine and skips this loop.
So my question is, how can I compare multiple values? What am I doing wrong? Is there like a certain hierarchy thing I am missing?
Thanks for any help!
SM
Tagged: