Re: Looping over collections

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Looping over collections

Mike Cowlishaw-2
> I currently traverse collections the "1.4" way - by getting an
> Iterator, and then setting up a loop. Now that Java 5 (or 1.5) has the
> "for" instruction, I'm wondering whether something similar is going be
> implemented for Netrexx. If it has, any pointers shall be greatly
> appreciated.

I haven't looked at the Java FOR instruction, but if your collection is a
subclass of Dictionary (e.g., a Hashtable) then NetRexx has always allowed
you to iterate over it using LOOP OVER name.

mfc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>


Reply | Threaded
Open this post in threaded view
|

Re: Looping over collections

Mike Cowlishaw-2
> It's a Vector that's being returned which holds a bunch of custom
> classes. Is there any chance that this kind of feature will make it
> into Netrexx? The ability to iterate easily over List objects (or their
> subclasses ArrayList, Vector) would be useful indeed.

Hmm, but for those you have a known numerical index .. 'loop i=0 to
whatever' is going to be as fast as anything NetRexx would do, and maybe
as clear, too.
 
> On the topic of new feature requests, I'm curious - are there any
> planned for Netrexx in the near future?

I'm spending about 150% of my time on decimal-related things at the
moment, so don't hold your breath...

mfc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>