simple question

Started by
5 comments, last by Taile 22 years, 5 months ago
what does this mean: for each
Advertisement
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
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])
Actually, you can do it in C++ too, with the for_each algorithm on the STL container classes.
C# Supports it also, if anyone cares.
Actually I meant in C++. I dont understand....
It gave something like this:
for each function()
{
...
}
Well, that''s not actually valid C++, so I think it was probably just trying to give you pseudocode or something.

This topic is closed to new replies.

Advertisement