Not much difference really. Every collection interface has an ITEM and COUNT property. That never changes. It's just that we have numerous ways that we can walk the collection. Here's another one, this might be the fastest work-around method:

break on

$installer = CreateObject("WindowsInstaller.Installer")

$components = $installer.components
$count = $components.count

while $i < = $count
 ? $components.item($i)
 $i=$i+1
loop

exit 1


I can't get the less-than sign posted ! Whats up with that ? Anyway...

The FOR EACH method just implements an internalized counter and a conditional statement on our behalf, and provides a convenient mechanism for pulling out and assigning the object. Other than that, its exactly the same thing. But in the case of kixtart's builtin enumeration, I think you guys have found a bug. Not too sure if its kixtart or windowsinstaller that is causing the problem. Only one guy can answer so I've sent off an email to Ruud and asked him to comment.

-Shawn

[ 21 March 2002, 05:08: Message edited by: Shawn ]