Home News DOC Class DL Others Rice
Class  >  timer  >  timer(class,string,int)
timer class : timer(class,string,int) fitter

Description

Returns a new instance of timer class.

Syntax

new timer(class handleInstance, string signature, int interval)

Arguments

ClassNameDescription
user-defined classhandleInstanceAn instance of a user-defined class.
stringsignatureHandler signature.
intintervalTime interval.

Return value

ClassDescription
timerA new instance of timer class.

Sample code

Suppose you have the following class definition.

1:

class handle

2:

open method void THandler(dictionary dic)

3:

... // timer handler code.

4:

endmethod

5:

endclass

Usage of the timer(class,string,int) fitter is as follows.

1:

timer tim = new timer(h, "THandler(dictionary)", 1000);

Notes

A returned instance has been initialized.

First argument:

Specifies an instance of the class that has a handler as a member.

Second argument:

Specifies the handler signature.

Third argument:

Specify a number that is greater than 0 and less than or equal to the maximum int.

The unit is milliseconds.

The signature is the information for the timer to call the handler. It is a string that concatenates the handler method name and arguments.

The handler must be an open method with one argument of the dictionary class. If the method name of the handler is "handlerName", the definition of the handler is as follows.


"handlerName(dictionary)"

Links for reference

None.

Copyright © Rice All rights reserved.