PDA

View Full Version : foreach question



Dangerman
10-01-2003, 09:08 AM
I've been studying LScripts, and the LScript docs and I was wondering what the parameters of the "foreach" loop are.

foreach appears a few times in the docs, but there's no information on how to use it, or what the parameters mean.

Thanks for any help you can provide.

fxnut
10-01-2003, 11:11 AM
Hopefully this'll explain it. Basically, this:

foreach( myvariable, myarray )
{
....
}
is identical to doing this:


var n = sizeof(myarray);
for(i=1;i<n+1;i++)
{
var myvariable = myarray[i];
....
}

Dangerman
10-02-2003, 02:00 PM
Thanks!