|
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: Fri Dec 13, 2013 8:07 pm
record variable help |
This is probably a silly question, but after hours of reading I still cant find an answer so here goes.
I'm just trying to access information inside the fields of a record variable.
I create a record from a trigger using:
#ADDKEY chess@chessnum {rmname=%roomname}
#ADDKEY chess@chessnum {rmnum=%roomnum}
#ADDKEY chess@chessnum {boardnum=@chessnum}
This creates the chess##### record just fine, I can see all the correct information stored inside.
Where I seem to have hit a brick wall is trying to assign the information to another variable.
tempvar = chess####,chessnum: I need to pull chessnum out of one of the records and send it to a variable I can call upon with an alias.
or if I could just use the info inside the record that would be fine too
something like:
telepathic move @chessnum is the command i need sent to the mud. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Dec 13, 2013 10:22 pm |
Use dot-notation, but as that might not actually work you might instead have to use the %db() function:
var = @datarecord.key
var = %db(@datarecord,key)
The reason I say dot-notation might not work is that in some cases the parser will fully expand the toplevel variable reference and then append the .key to that expanded value. The %db() function does not have this issue, and in fact you can use complex or even illegal variable/key names (for example, you could reference a variable with a space in its name.) |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|