Hi experts
In my code i m using a boolean & ternary check like shown below code snippet.
When my code executes boolean is set to false, then changes to true after 1st if , displays PASS (which means boolean is true ) from ternary , however 2nd if condition fails and it shows boolean isPass value to FALSE in debugger.
Wondering if its a BUG which resets the value of boolean to false when evaluated via ternary operators ?
Please suggest a fix.
class test { boolean isPass = false; if (some condition ) { isPass = true; } isPass = true ? info("Pass") : error("FAIL")); // Info Pass if(some condition && isPass) // Will not execute as isPasss becomes FALSE { } }
Actual code for runclass if you want to test this issue. If it is indeed a bug then do I get a reward....Just checking.... :-) :-) :-)
class rcternarybugcheck { ////// Runs the class with the specified arguments. /// /// The specified arguments. public static void main(Args _args) { boolean isPass; if (1==1) isPass = true; isPass = true ? info("Pass"):Error("Fail"); if(1==1 && isPass) info("BUGpass"); info(strFmt(enum2Str(isPass))); } }
Thanks
Mav