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
shazara
Beginner


Joined: 17 Feb 2003
Posts: 16
Location: USA

PostPosted: Sun Mar 26, 2006 7:17 pm   

Data record with stringlist values
 
What I want is a datarecord variable that has a stringlist as each key's %val

For example
#VAR enemiesfound {Titan[]South Karr Street|Lyra[]Byron Edmund Square|Estarr}

So I used the following:

#loopdb @enemiesfound {#additem enemiesfound.%i PLACENAME}

But then I get periods in my values, like so

Titan: South Karr Street..|Lyra.|PLACENAME.|PLACENAME.|PLACENAME
Byron: Edmund Square..|Estarr.|PLACENAME.|PLACENAME.|PLACENAME

How can I fix this?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Mar 27, 2006 4:29 am   
 
You might have luck with using {} or quotes around %i, but if that doesn't work you can use the old standby of #ADDKEY. #ADDKEY works a little differently than #ADDITEM in that it replaces the value instead of adding to it. Therefore, when adding a new value to whatever already exists you need to also use %db() and %concat() to access the current value:

#addkey DaterecordVariable FieldName %concat(%db(@datarecordvariable, fieldname),"|", your new thing here, either a variable name or a string contained in quotes)
_________________
EDIT: I didn't like my old signature
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