Dependent on parens, $v1 and $v2 are set to different values for the same condition:

Code:
;; 1 - 2
if 1 == 2 || 2 == 2 echo -a $v1 - $v2
if (1 == 2 || 2 == 2) echo -a $v1 - $v2

;; 1 - 1
if 1 == 1 && 2 == 2 echo -a $v1 - $v2
if (1 == 1 && 2 == 2) echo -a $v1 - $v2

;; 2 - 2
if 1 == 2 || 2 == 2 { echo -a $v1 - $v2 }
if (1 == 2 || 2 == 2) { echo -a $v1 - $v2 }
if (1 == 2) || (2 == 2) echo -a $v1 - $v2
if (1 == 2) || (2 == 2) { echo -a $v1 - $v2 }

;; 2 - 2
if 1 == 2 && 2 == 2 { echo -a $v1 - $v2 }
if (1 == 2 && 2 == 2) { echo -a $v1 - $v2 }
if (1 == 2) && (2 == 2) echo -a $v1 - $v2
if (1 == 2) && (2 == 2) { echo -a $v1 - $v2 }


Its expected that all should result in $v1,$v2 being set to 2

This may very well be related to an underlying issue with the OR operator where:
- if the last condition of an if-statement makes the if's overall condition truthy mIRC has no problem with processing
- if a condition in the middle of the statement would make the if's overall condition truthy mIRC raises an error

Code:
;; these process the condition without issue (but sets $v1,$v2 incorrectly)
if 1 == 2 || 3 == 3 /noop
if 1 == 1 || 2 == 3 { noop }

;; These raise an "/if: ambiguous format" error
if 1 == 1 || 2 == 3 /noop
if (1 == 1 || 2 == 3) noop

Last edited by FroggieDaFrog; 15/07/17 12:46 AM.

I am SReject
My Stuff