Time field (please help)

Rob Cozens rcozens at pon.net
Sun Mar 3 11:48:01 EST 2002


>>> How do you get the field to display live time?
>>
>> Try using <on idle >in the script of the field.
>
>The use of 'on idle' should be avoided. Instead, write a handler in the
>script of the field that is called by an openCard handler:
>
>send updateTime to field "Now"
>
>and let the handler call itself in 1 second:
>
>on updateTime
>  put the long time into me
>  send updateTime to me in 1 second
>end updateTime

Terry, Björnke, et al:

Question:  What happens when the user goes to another card or another
stack?  Must one take some action on closeCard/closeStack to stop
updateTime from continuing to send messages every second?

I suppose so long as there is no updateTime handler in the current message
hierarchy the last updateTime message will not be handled; however, in
general I'm leary of starting continuous loops without scripting a means to
stop the loop if desired or necessary.  And, in truth, I don't know what
RunRev does when instructed to send a message to a control that is no
longer in the message hierarchy.

Can someone reduce my fooleshness on this subject?



Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)



More information about the use-livecode mailing list