mzScript...!varMod does not work. Thread last updated on 2004-08-14 23:45:26

Posted by member 12025 on 2004-08-14 22:46:23

*script exec !ParseEvars !varSet curIcons %#VTrayCurrentIcons%#
*script exec !varset mod %{curIcons}
*script exec !varMod mod %{VTrayWrapCount}

Simply: !varMod does nothing. Why? It seems it should set mod to the remainder of the current value of mod...instead ot does absolutely nothing.

Posted by member 99 on 2004-08-14 23:22:28 link

Because it's got its logic inverted where it tries to protect against division by zero:
if (atoi(val) != 0)
return;

Posted by member 37809 on 2004-08-14 23:22:33 link

yea, it doesn't work.

; c = a mod b
*script bang !modulo ;c a b
*script exec !varset modulo %#%{\2}/%{\3}%#
*script exec !varset %{\1} %#%{\2}-%{modulo}*%{\3}%#
*script ~bang

Posted by member 12025 on 2004-08-14 23:45:26 link

tnl, I already did a bang for it, but wanted to check and see if maybe the docs weren't just being a bit mysterious :).
And now I've gotten rid of the bang, as it's more work (scripting-wise) than doing a loop like I had before.
*script LABEL GetWraps
*script exec !varAdd tmpWrap %{VTrayWrapCount}
*script exec !varAdd trayRows 1
; *script exec !msgbox %{tmpWrap} %{curicons} %{trayRows}
*script GOTOIF ( "%{tmpWrap}" < "%{curIcons}" ) GetWraps