Jump to content
Sign in to follow this  
mr_unreliable

how to pick out specific item from collection

Recommended Posts

mr_unreliable

hi gang,

I would like to pick out a specific item from a collection.

I tried the emum items capability and it works fine, i.e.,

For $Match In $Matches ; (for each) loop through the $Matches collection

...

Next

To go one step further, in vbScript, it is possible to pick out

an individual item like this:

$Matches(1).Value

That is vbs shorthand for specifying a specific item like this:

$Matches.Item(1).Value

Both of these syntaxes work in vbs, but I couldn't get either

to work in au3b.

Note: I also tried square brackets, which didn't work either.

Am I missing something, or is it not possible to address an

individual item in a collection???

tiafah, jw

Share this post


Link to post
Share on other sites
seandisanti

hi gang,

I would like to pick out a specific item from a collection.

I tried the emum items capability and it works fine, i.e.,

For $Match In $Matches ; (for each) loop through the $Matches collection

...

Next

To go one step further, in vbScript, it is possible to pick out

an individual item like this:

$Matches(1).Value

That is vbs shorthand for specifying a specific item like this:

$Matches.Item(1).Value

Both of these syntaxes work in vbs, but I couldn't get either

to work in au3b.

Note: I also tried square brackets, which didn't work either.

Am I missing something, or is it not possible to address an

individual item in a collection???

tiafah, jw

personally i don't use collections much, i prefer arrays....you could easily create an array and add the items of the collection to the array, so that they could be referenced by index.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×