Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
eupher
Apprentice


Joined: 18 Jan 2001
Posts: 116
Location: USA

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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}
Reply with quote
eupher
Apprentice


Joined: 18 Jan 2001
Posts: 116
Location: USA

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 13, 2003 7:44 pm   
 
#FORALL @temp_list {#SHOWDB %i}
Reply with quote
eupher
Apprentice


Joined: 18 Jan 2001
Posts: 116
Location: USA

PostPosted: Sat Sep 13, 2003 8:04 pm   
 
Sweet. Thanks again.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net