Hi.
So much fun. I do not know how your start time and end time are placed in your fields. Are they two words? Two lines? It matters, because we want to be able to access both pieces of information.
Now, the convert command will take a value like "12:15", and assume it is on the current day. But this means that a "common denominator" can be thought of being present in each field, so that only the "local" value need be considered. This is a good thing. In other words, as a test, make two fields, one with "12:15" in it, and one with "12:30" in it. Now try this in a button:
Code: Select all
on mouseUp
put fld 1 into early
put fld 2 into later
convert early to seconds
convert later to seconds
answer later - early
end mouseUp
The "900" you get is the 15 minute difference between the two values. See? The time can be dealt with on a strictly "local" value level.
But now ON A NEW CARD make another field, and put a time that is a minute in the future. Now try this in button on that card:
Code: Select all
on mouseUp
startChecking
end mouseUp
on startchecking
put the seconds into line 2 of fld 1
repeat with y = 1 to the number of flds
get fld y
convert line 1 of it to seconds
if the seconds - it > 0 then
answer "You are late"
exit to top
end if
end repeat
send "startChecking" to me in 1 second --This might be "600 seconds" in your actual app.
end startchecking
Your homework is to figure out what all this is doing, and write back with how you are making your app work.
Craig Newman