ptp
USA
Asked
— Edited
@DJ,
For the next release, can you please add:
- Modulus Function e.g. Mod( Number1, Number2 ) OR
- Modulus operator e.g. Number1 % Number2
I know you can use plugins to add custom functions, but they don't work on mobile applications.
Modulus is so versatile and useful deserves a place in EZ-Script.
Simple examples:
1)
$counter=0
:loop
#do something
if (Mod($counter,100)=0)
print("Debug info")
endif
Sleep(100)
$counter=$counter+1
Goto(loop)
#calculate the difference between $angle1 and $angle0
$diff=Abs( Mod($angle0+180-$angle1, 360) - 180)
Use the % like C and other programming languages.
Outputs:
I missed that one
i tried before
I got an error but it's the space between the (. So i assumed didn't existed
Thanks
Roger
I might make a global option one day to allow no spaces between functions. But i added space requirements two years or so ago to force users to format their code for readability. There were crazy scripts with issues reported because users couldn't understand their own formatting. So now it's mandatory to format with spaces and the number of users posting script assistance has dramatically reduced. The result is that it is much easier to read with spaces rather than one mess without