modulo Thread last updated on 2007-12-15 16:35:42

Posted by member 106929 on 2007-12-14 17:28:40

hi

sorry, but this is probably a dumb question (and im not sure where it belongs--and cannot find the answer anywhere), but can i use the modulo operator (%) in litestep\'s if/else statements. also, is there a way to chain conditions inside the if or else statements (like && or ||)?

thanks

Posted by member 1 on 2007-12-15 08:13:28 link

Wildcards are not supported, just exact pattern matching. And as for AND and OR...

http://lsdocs.shellfront.org/config.php

Posted by member 212670 on 2007-12-15 09:45:30 link

For modulo, if you're using one of the experimental LS builds, you can do things like...

a 12
b 5
c "$a mod b$"

If c < 1
d 5
Else
d 10
EndIf


In the above example, !alert $c$ will return 2, and !alert $d$ will return 10.

Or use mod directly...
If "$a mod b$" < 1
d 5
Else
d 10
EndIf


See the math.txt included in the experimental LS build's zip.

Posted by member 106929 on 2007-12-15 16:35:42 link

thank you :)