|
Davos Adept
Joined: 30 Jan 2003 Posts: 228 Location: USA
|
Posted: 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 |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
Davos Adept
Joined: 30 Jan 2003 Posts: 228 Location: USA
|
Posted: 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 |
|
|
|
asira Beginner
Joined: 24 Jun 2002 Posts: 24 Location: United Kingdom
|
Posted: 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 |
|
|
|
|
|
|