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
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Fri Jun 06, 2003 3:54 pm   

Extracting value from a record variable
 
The helpfiles on record_variables are quite thin or I'm reading in the wrong places because I always get stuck when it comes to working with lists

Anyhow, I'm storing a lot of values in a record_variable_list like (spellbook and the spells that it contains):

record_variable_list
armor | book2
bless | book1
silence | book2
web | book1

etc,

PATTERN
You are not holding a spellbook that contains the spell '&spell_name'.

TRIGGER
I need to query my record_variable_list to find out which spellbook the @spell_name is stored in.

Something like #FIND record_variable_list @spell_name #RETURN "value_next_field".

If the @spell_name was "bless" I would like the trigger to store value "book1" in (a new) variable @spell_book.

Any help as always much welcome!

I will then use a second trigger that retrieves "book1" and cast "bless" again.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jun 06, 2003 5:23 pm   
 
#VAR spell_book %db(@record_variable_list, @spell_name)

Kjata
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