Raised This Month: $ Target: $400
 0% 

Code syntax to reset variables to zero?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-22-2009 , 14:32   Re: Code syntax to reset variables to zero?
Reply With Quote #6

Yes, the first statement works. What it does is this:

PHP Code:
g_votes[0] = g_votes[1] = g_votes[2] = 0
  • Step 1 -
    PHP Code:
    g_votes[2] = // let's call this statement "VOTES_2" 
  • Step 2 -
    PHP Code:
    g_votes[1] = VOTES_2 // let's call this statement "VOTES_1" 
  • Step 3 -
    PHP Code:
    g_votes[0] = VOTES_1 
At each step, the previous statement evaluates to whatever you're assigning to.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode