## Timer

### Description

The Timer class implements a periodic timer. This is an invisible object, which calls the `onTimer` callback at a fixed interval (provided the object's `enabled` property is 1). The time interval is set by the `interval` property, and is expressed in milliseconds.

A Timer object can be a top-level object (created directly using ŒNEW,or the `New` or `Create` method of ŒWI). It can also be the child of the System object, of a Window or Form, or of any standard control. It cannot be the child of a pre-defined dialog or another Timer object.

### Example

         ’DEMO_Timer;CB_TIMER;DEMO
    [1]   © Sample function demonstrating use of the Timer object
    [2]   DEMO„'Œ' ŒNEW 'Window'
    [3]   DEMO.where„4 4 ª DEMO.scale„1 ª DEMO.size„7 30
    [4]   DEMO.title„'Timer Example'
    [5]   DEMO.myLabel.New 'Label' ª DEMO.myLabel.where„2 1
    [6]   DEMO.myLabel.caption„''
    [7]   © Set up 1-second timer which updates the label text
    [8]   DEMO.myTimer.New 'Timer' ª DEMO.myTimer.interval„1000
    [9]   © Create a little callback function which will run once a second
    [10]  0 0½ŒFX 'CB_TIMER' 'DEMO.myLabel.caption„ŒTIME'
    [11]  DEMO.myTimer.onTimer„'CB_TIMER'
    [12]  ©
    [13]  © Wait for the user to close the window
    [14]  0 0½1 ŒWE DEMO
         ’

### Properties

children class data enabled events interval methods name opened properties self tie

### Methods

Close Create Delete New Open Send Set Trigger

### Callbacks

onClose onDestroy onOpen onSend onTimer

Topic: APLX Help : System Classes : List of Classes : Timer

[ Previous | Next | Contents | Index ]