Thread: for
View Single Post
  #14  
Old 02-21-2005, 05:22 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by falco10291029
Actually the for-each command can replace with, and the for loop cant without using with, so yes i believe it can, plus stefan said himself that it's meant to.
It doesn't replace with, if it did, this would work:

PHP Code:
for(plallplayers) {
  
client.test "blah";

but it doesn't.

you still have to do:

PHP Code:
for(plallplayers) {
  
with(findPlayer(pl.account)) {
    
client.test "blah";
  }


You can also just aswell do:

PHP Code:
allplayers[index].account 
no need for a foreach loop at all.
__________________


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