Time field (please help)

Björnke von Gierke bvg at mac.com
Sat Mar 2 20:15:00 EST 2002

On Sonntag, März 3, 2002, at 01:28 , Steve L wrote:

> ...
> How do you get the field to display live time?
> ...

A command is always executed once. When you want to do things repeatedly 
you have to issue the command repeatedly too. You can achieve that by 
using a loop (see "repeat" in the documentation).
But in your case that would not be the ideal solution, as a loop can 
block other things from happening (not so well documented, as far as I 
know) thus you should rather search for "send" in the docu. As you can 
issue future command with it! Here is a example (solving your problem) 
how I would make it:

on preopenCard
end preopenCard

on setTheTime
   put the short system time into field "myTimeField"
   send setTheTime to me in 1 second
   --note that you can also send things to any other object
   -- You are not restricted to "me":
   --send setTheDate to field "myDateField" in 1 second
   --naturally you have to have that Handler (setTheDate) in that field!
end setTheTime

hope this makes it clear to you
Björnke von Gierke

PS: Try to read all the "About" topics in the documentation they helped 
me really often.

More information about the use-livecode mailing list