Raised This Month: $ Target: $400
 0% 

increase understanding.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-27-2007 , 17:04   increase understanding.
Reply With Quote #1

as you know, you can do
Code:
variable++
to increase the variable by 1.

i understand this:
Code:
new variable; public repeating_task() {     variable++;     if(variable > 2) variable = 0;     // do something with variable. }

and i know how it works in the "for" loops.

what i dont understand is the way im using it here:
Code:
new variable; public repeating_task() {     if(variable > 3) variable = 0;     switch(variable++)     {         case 0: // something...         case 1: // something...         case 2: // something...         case 3: // something...     } }

now in the switch, say the variable was greater than three and it was reset to 0.
does the switch use the increased variable or does the variable increase after the switch?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 16:11.


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