View Single Post
  #22  
Old 12-18-2011, 01:10 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by khortez View Post
PHP Code:
player.chat "Boots" SPC  (this.boots "on!" "off!"); 
in a script like that, i can see where true is defined, but...


PHP Code:
 player.chat "Boots "@ ((this.boots = !this.boots)? "on!" "off!"); 
where exactly was it defined in this?
in some languages, the entire assignment operation [e.g. (this.boots = !this.boots)] returns a value: the value of the left hand side of the equation after the assignment takes place.

In other words, the value of
PHP Code:
(this.boots = !this.boots
is equal to the value of this.boots after it is set to !this.boots

edit: I wouldn't worry about all of these little "shortcuts" right now. They make your code less clear, and as someone who is still learning, it is better to be as straight forward as possible.
__________________
Reply With Quote