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
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Mon Nov 20, 2006 1:23 pm   

@@var how to expand a the value of a var as a var
 
I've looked into %expand, and it is not what I am after.


var=var2
var2=123
#IF (@@var != 122) {#var @var 120}

The expression wont evaluate, and even when I force it to evaluate true, I cannot change the value of var2 by only referencing @var.


Is this possible some way?
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Mon Nov 20, 2006 1:46 pm   
 
Bit odd, and I only guessed it by playing with various brackets, parenthesis and functions

%eval(@@var)
#var [@var] 120

#IF (%eval(@@var) != 122) {#var [@var] 120}
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Mon Nov 20, 2006 1:48 pm   
 
Actually, you can just use %eval for both bits
#var %eval(@var) 120
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Nov 20, 2006 2:41 pm   
 
The syntax you're looking for is @{@var} I believe. Works in CMUD anyway.
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Tue Nov 21, 2006 6:39 am   
 
Guinn wrote:
Actually, you can just use %eval for both bits
#var %eval(@var) 120

Heh yeah, [ ] brackets are just shorthand for %eval.

I actually tried %eval, but only as %eval(@var) - not with the @@. Thanks heaps Smile

Oh, and Fang, I think thats one of the differences with cmud. Weird stuff like this has been simplified loads.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Nov 21, 2006 7:30 am   
 
Yeah. I'm becoming kinda useless at giving zMUD advice now, CMUD is spoiling me :P
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Nov 21, 2006 8:50 am   
 
Actually @{@var} is the correct syntax in zMud as well.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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