Page 1 of 1

repeating time in field

Posted: Sat Apr 07, 2012 6:03 pm
by KennyR
Is there a way to create a loop or repeat function that continuously updates the current time in a field? I have been trying to make this work with something like below:

on preOpenCard
repeat forever
put the time into fld "time"

if fld "time" is "12:00 PM" then

answer "Blah blah blah"

else
end if
end repeat
end preOpenCard

--But this just either loops the blank screen until a condition is met, or it will not put the time in the "time" field....I would like to have the loop check the time until a certain time is met then send a msg to the user, then keep looping until that time is met once again...and so on.....

thanks for the help

Re: repeating time in field

Posted: Sat Apr 07, 2012 6:23 pm
by Dixie
You could use something like this...

Code: Select all

on openCard
   setTime
end openCard

on setTime
   put the seconds into tempTime
   
   -- if tempTime = whatever then
   -- do whatever
   -- end if
   
   convert tempTime to long time
   put tempTime into fld 1
   send "setTime" to me in 1 second
end setTime

You will have to juggle with the seconds, but this should get you started

be well

Dixie

Re: repeating time in field

Posted: Sun Apr 08, 2012 6:29 pm
by KennyR
Thank you Dixie for taking the time to help! Im going to try this code out now...have a great week...