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
Tsara
Newbie


Joined: 25 Feb 2006
Posts: 2

PostPosted: Sun Feb 26, 2006 3:42 pm   

Dynamically accessing string members.
 
Not sure if I have the words correct but it boils down to this.

#ALIAS price {#sh @PriceMapping.@stat} "test"
#VAR PriceMapping {f39=5|f41=6} {_nodef} "test"
#VAR stat {f39} {_nodef} "test"

Not sure what the (_nodef} thingie means but the purpose of the script is to value the price of an item after you grabbed its stats in the variable stat. Its value is lookep up in the table Pricemapping with the variable stat as key.

Problem is zmud doesnt view @PriceMapping.@stat as a member of Pricemapping but rather as one empty variable a dot and the value of the variable stat.


Please help we are getting desperate.

Edit Actaully I long since past the stadium of getting desperate
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Feb 26, 2006 5:07 pm   
 
First PriceMapping has to be setup as a record variable. It looks like an export for it that way, but make sure that is the actual setup.
#ALIAS price {#sh @{PriceMapping.@stat}} "test"
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tsara
Newbie


Joined: 25 Feb 2006
Posts: 2

PostPosted: Sun Feb 26, 2006 5:31 pm   
 
just using
#sh @{PriceMapping.@stat}
doesnt work how do i setup pricemapping as a record variable? (its static btw)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 26, 2006 5:36 pm   
 
Dunno if that works, but wouldn't it just be easier to use %db()?

#show %db(@Pricemapper, @stat)
_________________
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