|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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? |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Nov 20, 2006 2:41 pm |
The syntax you're looking for is @{@var} I believe. Works in CMUD anyway.
|
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: 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
Oh, and Fang, I think thats one of the differences with cmud. Weird stuff like this has been simplified loads. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Nov 21, 2006 7:30 am |
Yeah. I'm becoming kinda useless at giving zMUD advice now, CMUD is spoiling me :P
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|