General
: K-Meleon Forum
General discussion about K-Meleon.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=JamesD] I can find no error in the code. Here is my test. If any of the three iterations is true the answer is 3 else the answer is 4. I tested with $b and $c equal and unequal. [code] $b = 1; $c = 2; $d = 3; $x = 4 ; #<<<--- this, doesn't work $a = $b != $c ? $d : $b != $c ? $d : $b != $c ? $d : $x; #when b&c are 1 a equal 4 %%% 1st false 2nd false 3rd false #when b=1 and c=2 a equal 3 %%% 1st true alert($a, "first value of $a"); #<<<--- this works $a = $b != $c ? $d : $b == $c ? $d : $b == $c ? $d : $x; #when b&c are 1 a equal 3 %%% 1st false 2nd true #when b=1 and c=2 a equal 3 %%% 1st true alert($a, "second value of $a"); #<<<--- this works $a = $b == $c ? $d : $b != $c ? $d : $b == $c ? $d : $x; #when b&c are 1 a equal 3 %%% 1st true #when b=1 and c=2 a equal 3 %%% 1st false 2nd true alert($a, "third value of $a"); #<<<--- this of course works $a = $b == $c ? $d : $b == $c ? $d : $b == $c ? $d : $x; #when b&c are 1 a equal 3 %%% 1st true #when b=1 and c=2 a equal 4 %%% 1st false 2nd false 3rd false alert($a, "fourth value of $a"); ##Are you tried with "()": $a = ($b != $c) ? $d : ($b != $c) ? $d : ($b != $c) ? $d : $x; #when b&c are 1 a equal 4 %%% 1st false 2nd false 3rd false #when b=1 and c=2 a equal 3 %%% 1st true alert($a, "fifth value of $a"); [/code][/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development