[thelist] Visual Basic 6.0 - Iterating through Collections... .

Scott Dexter sgd at ti3.com
Tue Nov 14 16:24:27 CST 2000

Actually, that gets the Key. One more step and you have it:

	varKeyValue= dictCategory(CatItem)

>    For Each CatItem In dictCategory
>       ' This will get the "Item" from the Collection
>       varFunctName = CatItem
>       ' How do I get the "Key"
	' *** YOU JUST DID ****

	' Now get the Item
	varFunctValue= dictCategory(CatItem)
>    Next

Here's the example that I remembered to grab Keys and Values out of a
collection (note the obscure place)

<TR><TD><B>Server Variable</B></TD><TD><B>Value</B></TD></TR>
<% For Each strKey In Request.ServerVariables %> 
<TR><TD> <%= strKey %> </TD><TD>  <%= Request.ServerVariables(strKey) %>
<% Next %>

That's right, I originally found it looking up Request.ServerVariables. Go

Lemme know if this ain't doin it forya--

More information about the thelist mailing list