Thread: Clientr.PROBLEM
View Single Post
  #2  
Old 10-10-2007, 11:33 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by napo_p2p View Post
Consider
PHP Code:
something = (b) ? 
If the condition before the ? is true, then 'a' is assigned to 'something', otherwise 'b' is assigned.

So in this case, xAndrewx's expression is pretty much the equivalent to:
PHP Code:
if (clientr.mud_nation == null) {
  
clientr.mud_nation "Neutral";
}
else {
  
clientr.mud_nation clientr.mud_nation;

(You can see that this isn't the best situation to use a ternary operation because there is no need to set clientr.mud_nation to itself).

EDIT: Ziro beat me to it, but hopefully now you get the point :P.
Bah, way to steal points from me by explaining everything.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote