ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Grandewd on August 31, 2013, 06:30:41 PM
-
Ok, here's that one line of code:
Is this proper:
if #chardir <> 2 & #charX <> %mastX
or do I need to add parenthesis, as in:
if ( #chardir <> 2 ) & ( #charX <> %mastX )
or are both acceptable?
:-[ :-\ ::)
-
I do not remember being able to use the and symbol in an if statement (under easyuo scripting that is). So my response would be neither.
-
if ( #chardir <> 2 ) && ( #charX <> %mastX )
I honestly cant remember much of EUO syntax, but I do believe that it requires "&&" as opposed to "&".
Parenthesis are in relation to what you want to be compared first. It's just good practice to use them imo. For longer compares it really matters though.
-
if ( #chardir <> 2 ) && ( #charX <> %mastX )
I honestly cant remember much of EUO syntax, but I do believe that it requires "&&" as opposed to "&".
Parenthesis are in relation to what you want to be compared first. It's just good practice to use them imo. For longer compares it really matters though.
You're right on both counts, dxrom... The EUO syntax does call for an && - can't believe I forgot that.... And you're really right about the importance of using parenthesis - at the very least for an appreciation of the esthetic beauty of orderly code - if not a much easier way to spot what they point us to...
But hey, look at the bright side... My forgetfulness allowed us (well at least one of us) a moment to enjoy the memories... Right? ::)