|
benjunmun Beginner
Joined: 23 Feb 2002 Posts: 23
|
Posted: Fri Apr 06, 2007 1:14 am
Math Confusion |
Ok, so I am trying to make an alarm that will decrease the value of each item in a database variable every second. The code in the alarm is :
Code: |
#loopdb @failsafe {
#if (%val < 0) {
#delkey failsafe %key
} {
#addkey failsafe %key (%val-1)
#echo %val %key
}
}
|
However, the %val-1 seems to always evaluate to -1 rather than decreasing %val by 1.
I've tried a bunch of ways using #math and other things, but I can't seem to figure it out. I'm probably doing something wrong, so if someone could point it out I would greatly appreciate it. |
|
|
|
benjunmun Beginner
Joined: 23 Feb 2002 Posts: 23
|
Posted: Fri Apr 06, 2007 1:16 am |
Ah, wait, I figured it out. I need to use %number on the %val to make it evaluate as a number. Would this be a bug in the autotyping?
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Apr 06, 2007 4:25 am |
Sounds like a bug in the autotyping for %val. I've added it to the bug list. Thanks for reporting it.
|
|
|
|
|
|