|
Procyon Newbie
Joined: 21 Jan 2007 Posts: 6
|
Posted: Tue Jan 23, 2007 9:06 am
[1.24] - sign not parsed as operator with dbvars |
I ran into this issue while looking for a workaround to the dbvar/#ADD problem I reported earlier.
The command #VAR test.one @test.one-1 results in @test.one being set to a null value instead of reducing the value by one.
I was dumbfounded but then realized it assigns to @test.one the contents of the nonexistent variable @test.one-1 instead of parsing - as the subtraction operator. Easily verified if you actually create the one-1 entry.
A simple enough workaround of a workaround is #VAR test.one %eval(@test.one)-1, but this was definitely unexpected behavior. + / * appear to work properly.
Also vaguely under this same topic, didn't want to post separately for this... the modulus operator of zMUD, \, doesn't appear to work - not implemented at all? Will it be? Of course possible to use %mod(), just wondering. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Jan 23, 2007 5:23 pm |
\ isn't implemented
I'd also like to see ^ for exponents. |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jan 23, 2007 5:44 pm |
Added to bug list, but to force expression evaluation, you can just put () around the expression:
#VAR test.one (@test.one-1) |
|
|
|
Procyon Newbie
Joined: 21 Jan 2007 Posts: 6
|
Posted: Tue Jan 23, 2007 8:28 pm |
#VAR test.one (@test.one-1) also experiences this problem, as does #VAR test.one %eval(@test.one-1) which is something I tried originally. But akin to %eval(@test.one)-1, (@test.one)-1 does work, indeed.
|
|
|
|
|
|