Thread: command?
View Single Post
  #3  
Old 01-05-2004, 11:06 PM
DIABLO2099 DIABLO2099 is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 290
DIABLO2099 is on a distinguished road
Yeah, the for command is a type of loop.
Using the example Loriel used:
NPC Code:
for (a ; b ; c)


a is usually where the variable initialization takes place.
NPC Code:
i = 0;



b is where the program checks whether or not the requirements to meet the loop are met. If the requirements are met, the loop is peformed and c is done.
NPC Code:
i < 10;



c is the increment.
NPC Code:
i++



Becareful not to place yourself in infinite loops...
NPC Code:
for (i = 0;i < 10;i--)


...such a case.

Hope I did not confuse you more than you were before .
__________________
-Former UnholyNation Server Manager.

Call me Xecutor.
Reply With Quote