View Single Post
Old 03-30-2011, 03:22 PM   #24
Syd Thrift
Hall Of Famer
 
Syd Thrift's Avatar
 
Join Date: May 2004
Posts: 10,040
I'm working on a scheduling thing, for example, which iterates over an entire List of fighters using the foreach iterator. Really, anything you could already do in a closed for loop, you can do in a foreach loop, and the great thing about foreach loops is that they automatically terminate at the end of your list - no accidentally setting them up to be endless. I also have an object called an AreaNode which represents a particular area a boxer might fight out of (for example, Bob's Gym or Philadelphia or The World), which includes in its class a List object of neighboring areas (Philadelphia for instance might neighbor New York City and Pittsbugh) and another List object of sub-areas (the Northeast might include all of Philadelphia, NYC, and Pittsburgh as well as other communities). That's essentially another collection itself, called a Tree, which may or may not be in VB.

If you really want to make your head spin, do a search on recursive programming. Or pointers (although you might want to then throw a little party for yourself that you haven't learned C++ if you do that).
__________________
Quote:
Originally Posted by Markus Heinsohn
You bastard....
The Great American Baseball Thrift Book - Like reading the Sporting News from back in the day, only with fake players. REAL LIFE DRAMA THOUGH maybe not

Last edited by Syd Thrift; 03-30-2011 at 03:25 PM.
Syd Thrift is offline   Reply With Quote