setTimeOut&cancleTimeOut

Object.setTimeOut

Run on: Called

Description


Use the SetTimeOut method to setup timed execution of a specified method. You only need to specify the name of the method to call, and the time in milliseconds before the function should be called.
The interval can be measured i two ways:If the last argument (idle) is TRUE (default), the interval is measured from when the keyboard or mouse was last used.If the idle-argument is FALSE, the time is measured from the call of SetTimeOut, without regard to keyboard use. The latter form should be used with care since time-intensive tasks activated while the user is using the machine can slow things down.

Syntax

public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )

Arguments

  • Method : Name of method to call.
  • WaitTime : Time in milliseconds
  • Idle : Set to TRUE if time should only be measured while the program is idle.

  • Returns

    Int - Timer Handle to be used if you need to Cancel the Timeout.

    Remarks


    The scheduled timeout is automatically removed after the method has been called. If you would like to cancel execution of the method before the specified time has elapsed, this can be done using the CancelTimeOut method.
    See the sample form tutorial_timer that demonstrates both idle and non-idle timers. Try using the keyboard in the two edit-fields, and watch one of the clocks stop. This is the one controlled by an idle timer.

    Example

    int th;
     
    th = this.SetTimeOut("TimedEvent",2000);
    ....
     
    int TimedEvent()
    {
        print "2 seconds has elapsed since the user did anything";
    }


    Object.setTimeOut

    Run on: Called

    Description


    Use the SetTimeOut method to setup timed execution of a specified method. You only need to specify the name of the method to call, and the time in milliseconds before the function should be called.
    The interval can be measured i two ways:If the last argument (idle) is TRUE (default), the interval is measured from when the keyboard or mouse was last used.If the idle-argument is FALSE, the time is measured from the call of SetTimeOut, without regard to keyboard use. The latter form should be used with care since time-intensive tasks activated while the user is using the machine can slow things down.

    Syntax

    public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )

    Arguments

  • Method : Name of method to call.
  • WaitTime : Time in milliseconds
  • Idle : Set to TRUE if time should only be measured while the program is idle.

  • Returns

    Int - Timer Handle to be used if you need to Cancel the Timeout.

    Remarks


    The scheduled timeout is automatically removed after the method has been called. If you would like to cancel execution of the method before the specified time has elapsed, this can be done using the CancelTimeOut method.
    See the sample form tutorial_timer that demonstrates both idle and non-idle timers. Try using the keyboard in the two edit-fields, and watch one of the clocks stop. This is the one controlled by an idle timer.

    Example

    int th;
     
    th = this.SetTimeOut("TimedEvent",2000);
    ....
     
    int TimedEvent()
    {
        print "2 seconds has elapsed since the user did anything";
    }

    See Also

    좋은 웹페이지 즐겨찾기