timer class : OneShot() method

Description

Starts the timer handling.

Syntax

instance.OneShot()

Arguments

None

Return value

None

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 OneShot() method is as follows.

1:

handle h = new handle();

2:

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

3:

tim.OneShot(); // The handler method will be called just once.

Notes

Calls the handler method only once after the set time has elapsed.

Timer handling stops after the call.

If this method is already called, re-call will be ignored.

Links for reference

None

Copyright © Cooker All rights reserved.