-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
codes in if statements are not parsed correctly #14
Comments
This doesn't make any sense. Aren't these two the same? |
NPE is Null Pointer Exception the example was not the best actually, a better example would be like: imagine a case where _bla actually IS nil... if you would write: |
its like a mini-if in an if. :D |
That's kind of weird that the scripting engine doesn't allow short circuiting (check up until one condition is false). I'll put in the change right now. This would also make for a nice code inspection... I think I'll make it one. |
this has been fixed for next version |
the it is still recommended to nest the later &&s in the code block further as the script engine still will parse everything otherwise reason for this btw. is because the script engine will interpret it like so: && which itself again is an expression --> where either the LArg or the RArg is the same again lazy evaluation just is a hacky way to prevent the execution at all |
a hacky but valid and working way. 2016-07-20 16:34 GMT+02:00 Marco Silipo [email protected]:
|
was just the explaination for that @BangL SQF does not knows lazy evaluation due to that |
i see. thanks for the expl. then :) offtopic: are you the x39, who made the xms 1 and 2 ? i was planning to contact you anyways. |
example:
if (isNull _bla && {_bla != ""}) then {};
in this example one if-condition is in {}-brackets, which will lead into this condition not beeing checked unless the other one was true. - this is a wonderful and proper way of preventing NPE's without having to make two nested if's, but sadly this is marked as invalid.
The text was updated successfully, but these errors were encountered: