Dialog.SetTimer/Dialog.KillTimer example?

Here's an example that creates a simple clock.

Clock.dcf (1.84 KB)


The script code looks like this:

Option Explicit
Function OnClick(ByRef clickData)

	Dim Dlg, Msg, Timer
	Set Dlg = DOpus.Dlg
	Dlg.template = "clock"
	Dlg.detach = True
	Dlg.Show

	Timer = Dlg.SetTimer(1000)

	Do
		Set Msg = Dlg.GetMsg()
		if Msg.event = "timer" Then
			DOpus.Output "tick"
			Dlg.Control("time").label = FormatDateTime(Now, vbLongTime)
		end if
	Loop While Msg
	
End Function