Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Procyon
Newbie


Joined: 21 Jan 2007
Posts: 6

PostPosted: 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.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: 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... ;)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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)
Reply with quote
Procyon
Newbie


Joined: 21 Jan 2007
Posts: 6

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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