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
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Fri Oct 20, 2006 2:09 pm   

[1.10] Using @var.%1 with #ADD
 
In calling a alias with the syntax of
i_testal testval

and the value of

#add countvar.%1 1

Its not incrementing the key in countvar by 1 for the value of testval like it should be
_________________
The Seaworthy
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Oct 20, 2006 3:17 pm   
 
I have the same problem still with #ADDITEM and #DELITEM. For now, I have to use a workaround of grabbing the value, tacking on what I want, and then re-assigning it. It's a pain, but it works. Hopefully, this syntax will be fixed in the CMUD parser one day, though.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Oct 20, 2006 4:37 pm   
 
I think this was mentioned in other threads, but commands like #ADD, #ADDITEM, etc that take a variable name do not support complicated syntax like this. Only #VAR currently supports it. It should be added to CMUD at some point.
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Fri Oct 20, 2006 10:40 pm   
 
Hmm whats the best way to work around this?
#var testvar @countvar.%1
#add testvar 1
#ADDKEY @countvar %1 @testvar

??
_________________
The Seaworthy
Reply with quote
asira
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: United Kingdom

PostPosted: Sat Oct 21, 2006 12:36 am   
 
That could be condensed into a single line, something along the lines of:
Code:
#addkey countvar %1 (@countvar.%1 + 1)

Or if you actually need to use the count result elsewhere (in the same alias):
Code:
$testvar = (@countvar.%1 + 1)
#addkey countvar %1 $testvar
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