|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Sat Sep 13, 2003 5:11 pm
list of db vars |
(zmud 6.62)
I'm not sure if this isn't supposed to work, or if I'm making a silly mistake...
temp_record.name=joe
temp_record.level=20
#additem temp_list @temp_record
#forall @temp_list {#showdb @temp_list.%i}
joe: joe
level: 20
temp_record=""
temp_record.name=betty
temp_record.level=15
#additem temp_list @temp_record
#forall @temp_list {#showdb @temp_list.%i}
joe: joe
level: 20
joe: betty
level: 15
I'm trying to process the contents of a who list after all the lines have been received and it'd be very helpful to be able to generate a list of db vars. Could someone tell me what I'm doing wrong and/or how to get around this behavior?
Thanks,
Eupher |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 13, 2003 6:59 pm |
It would be better to just use one db-variable, with each person's name for the key and level as the value.
#ADDKEY temp_record joe 20
#ADDK temp_record betty 15
#LOOPDB @temp_record {#SHOW name: %key;#SHOW level:%val;#CR} |
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Sat Sep 13, 2003 7:14 pm |
Sorry for the confusion. I simplified my example just to illustrate the basic problem. I'm actually capturing more information than just name and level from each line of the who list, so I need more than a key/value pair for each line.
Anyone know how to make this work?
Thanks again,
Eupher |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 13, 2003 7:44 pm |
#FORALL @temp_list {#SHOWDB %i}
|
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Sat Sep 13, 2003 8:04 pm |
Sweet. Thanks again.
|
|
|
|
|
|