Page 1 of 1

incremental checking

Posted: Fri Apr 06, 2012 3:42 pm
by d.m.holdawayGA2553
hello,

i have put a value into a variable and i want to check it every 5 increments

Code: Select all

if sTime = 5 or 10 or 15 or 20  then
send sHelp to field "data" 
end if
i was wondering instead of using 5 or 10 or 15 or 20 is there another bit of code i could use?

Re: incremental checking

Posted: Fri Apr 06, 2012 3:51 pm
by sturgis
Use mod. Its division that returns the remainder so: 12 mod 5 would be 2. 10 mod 5 would be 0 so in this case since you want increments of 5, if sTime mod 5 is 0 then... should do what you want.

if sTime mod 5 is 0 then
send sHelp to field "data"
d.m.holdawayGA2553 wrote:hello,

i have put a value into a variable and i want to check it every 5 increments

Code: Select all

if sTime = 5 or 10 or 15 or 20  then
send sHelp to field "data" 
end if
i was wondering instead of using 5 or 10 or 15 or 20 is there another bit of code i could use?