incremental checking

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
d.m.holdawayGA2553
Posts: 81
Joined: Mon Jan 09, 2012 4:48 pm

incremental checking

Post by d.m.holdawayGA2553 » Fri Apr 06, 2012 3:42 pm

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?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: incremental checking

Post by sturgis » Fri Apr 06, 2012 3:51 pm

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?

Post Reply