User Tools

Site Tools


timer_set_periodic_event_.htm
Navigation:  Language Reference > 9 -  Window and Report Attributes > Window and Report Attributes >====== TIMER (set periodic event) ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

TIMER(period)

blk2blue.jpg

TIMER Specifies a periodic event.
period An integer constant or constant expression specifying the interval between timed events, in hundredths of a second. If zero (0), no timed events generate.

The TIMER attribute (PROP:TIMER) specifies generation of a periodic field-independent event (EVENT:Timer) whenever the time period passes. The FOCUS() procedure returns the number of the control that currently has focus at the time of the event.

Value of timer has the UINT type. The Clarion IDE limits the timer value to 65365. If a higher value is required, it must be set using the property assignment statement.

Example:

RunClock PROCEDURE

ShowTime LONG

TimerValue UNSIGNED

!A WINDOW with a timed event occurring every second:

Win1 WINDOW,TIMER(100)

     STRING(@T4),USE(ShowTime)

    END

CODE

OPEN(Win1)

!You can also set the TIMER at runtime like this:

!TimerValue = 100000  !1000 second delay

!Win1{PROP:TIMER} = TimerValue

ShowTime = CLOCK()

ACCEPT

 CASE EVENT()

 OF EVENT:Timer

  ShowTime = CLOCK()

  DISPLAY

 END

END

CLOSE(Win1)

See Also: Event:Timer

timer_set_periodic_event_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1