mmm.....yeah I have been wondering this myself, but not really had time to investigate.
Guess you can do something like,
for x:=0 to MyCollectionThingy.items.count do
myname:=MyCollectionThingy.item[x];
From what I can see, it appears that Vb uses the For Each as another way or a nice way to do the above.....
Cheers,
Jeremy Coulter
Application Developer
Application Development Centre
Compaq Computer New Zealand Ltd.
Phone: 64 3 371 5724
Fax: 64 3 371 5724
Mobile: 64 0212533214
E-mail: [EMAIL PROTECTED]
Personal Email: [EMAIL PROTECTED]
-----Original Message-----
From: Ben Taylor [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 10, 1999 11:08 AM
To: Multiple recipients of list delphi
Subject: RE: [DUG]: VB (for..each) to delphi
Hi!
<wonders if this is slightly offtopic>
thanks for the reply, but.. it wasn't quite what i
was aiming for. I realise how the for..each is used,
what I was after is how does VB actually DO it. at
this point I am assuming that it uses an (unnamed/
undocumented) Interface to access/enumerate the
Collection. I am trying to find out what this
mechanism is, so that i can duplicate it the 'proper'
way in delphi...
Thanks.
> From: Jeremy Coulter [mailto:[EMAIL PROTECTED]]
> Subject: RE: [DUG]: VB (for..each) to delphi
>
> The "For Each" in VB is used alot for things like
> Collections and or recordsets.
<snip>
> does anyone know offhand what constructs vb uses in
> order to perform for..each operations, eg:
> <snip>
> ie does it use an IStrings interface or similar? as
> far as i can tell, SFS.SymbolNames has an IDispatch
_____________________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz