|
adamandkate Wanderer
Joined: 14 Oct 2009 Posts: 57
|
Posted: Mon Dec 21, 2009 3:04 pm
adding numbers to a key ? |
I currently have this simple script (thanks to the fantastic help of mattlofton)
#if (%iskey(@mylist,%4)) {#addkey mylist %4 %1}
Is there a way to make it ADD %1 to the current key.. rather then replace its current value?
eg..
mylist = one=14|two=28|three=6
if %1 = 10 and %4 = two..
it would lead to a variable of
mylist = one=14|two=38|three=6
where as currently it causes
mylist = one=14|two=10|three=6
Tried to use the math function to do what i want without much luck. will keep trying tho
thanks guys[url][/url] |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 21, 2009 5:23 pm |
#addkey mylist %4 (%db(@mylist,%4)+%1)
|
|
|
|
adamandkate Wanderer
Joined: 14 Oct 2009 Posts: 57
|
Posted: Tue Dec 22, 2009 9:15 pm |
thats great. thanks zugg. enjoy your xmas break
|
|
|
|
|
|