Posted by member 12025 on 2004-07-29 02:39:04 link

!varAdd -%{varname}
Dividing is a bit different. You need to use escape codes. Mainly %#, which becomes $. As you may know, evars can do some math. $5/10$ becomes 0.5. Trouble is that it really becomes 0.
*script exec !varMul %#1/%{varname}%#[code]If you're sure it will be an integer. Otherwise, maybe try[code]!varSet varname %#%{var1}/%{var2}%#
. That should do as follows, assuming 40 and 12:
-expand to %#40/12%#
-replace escape codes to $40/12$
-evaluate to 3.

FLoating point values are quite different. I'll be doing something for my next theme tomorrow, and will update with a working script for such things, as I'm about escape-coded out already, tonight :).