Thread: for
View Single Post
  #10  
Old 02-21-2005, 01:25 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by falco10291029
It's supposed to replace the with command
It does not replace the with command, and it is called a for-each loop.

PHP Code:
for(ab) {
  
// Code

What it really does it cycle through an array, and set the value of b with the next index to a.

It is essentially the same as:
PHP Code:
for(i=0;i<b.size();i++) {
  
b[i];

  
// Code

__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")