Skip to main content
gamedev.net
🔒 Locked

simple question

Started by Taile Nov 16, 2001 at 9:58 AM 5 replies 400+ views
Original Post
Taile
Taile
what does this mean: for each
JOL
JOL
I assume PERL:
if you have a collection with (key,value) pairs
you can iterate through all keys and get the value...

in english:
for each key in collection get value...

that is the idea of the keyword
for each
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I'm looking for work
krez
krez
it does that in visual basic too

  
For Each TH in ObjCollection
TH.MoveMe()
Next TH


that would call the MoveMe() method in all of the objects in ObjCollection.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
invective
invective
Actually, you can do it in C++ too, with the for_each algorithm on the STL container classes.
thurk
thurk
C# Supports it also, if anyone cares.
Taile
Taile
Actually I meant in C++. I dont understand....
It gave something like this:
for each function()
{
...
}
Kylotan
Kylotan
Well, that''s not actually valid C++, so I think it was probably just trying to give you pseudocode or something.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.