Getting info from a dictionary
Posted: Wed Mar 21, 2007 12:26 am
Basically i have extracted info from a cfg file with the GetConfigStringDictionary() function.
I want to use the name and its corresponding value in a gump so need to loop through the dictionary and extract both (the names are random).
I've tried
It doesn't like a variable being used i guess, anyone know of a way around this?
Edit: I'm doing 2 foreach loops to get around it, the second just loops (namedic) for the values of name. Dunno if its the only way to go about it, or is it the only way"
Edit2: foreach prop in racealigns (racealigns is a dictionary)
the _prop_iter returns the name of the prop instead of an iteration number. Is this right, or a bug with using it on a dictionary?
I want to use the name and its corresponding value in a gump so need to loop through the dictionary and extract both (the names are random).
I've tried
Code: Select all
foreach name in (namedic.keys())
Print(namedic.name);
endforeachEdit: I'm doing 2 foreach loops to get around it, the second just loops (namedic) for the values of name. Dunno if its the only way to go about it, or is it the only way"
Edit2: foreach prop in racealigns (racealigns is a dictionary)
the _prop_iter returns the name of the prop instead of an iteration number. Is this right, or a bug with using it on a dictionary?