Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Idle – PB Docs 126 – PowerBuilder Library

Idle – PB Docs 126

Idle PowerScript function

Description

Sets a timer so that PowerBuilder triggers an Application
Idle event when there has been no user activity for a specified
number of seconds.

Syntax

Argument

Description

n

The number of seconds of user inactivity
allowed before PowerBuilder triggers an Application Idle event.
A value of 0 terminates Idle detection.

Return Values

Integer. Returns 1 if it starts the timer,
and -1 if it cannot start the timer or n is 0
and the timer has not been started. Note that when the timer has
been started and you change n, Idle does
not start a new timer; it resets the current timer interval to the
new number of seconds. If n is null, Idle returns null.
The return value is usually not used.

Usage

Use Idle to shut off or restart an application
when there is no user activity. This is often done for security
reasons.

Idle starts a timer after each user activity
(such as a keystroke or a mouse click), and after n seconds
of inactivity it triggers an Idle event. The Idle event script for
an application typically closes some windows, logs off the database,
and exits the application or calls the Restart function.

The timer is reset when any of the following activities occur:

  • A mouse movement or mouse
    click in any window of the application

  • Any keyboard activity when a window of the PowerBuilder
    application is current

  • A mouse click or any mouse movement over the icon
    when a PowerBuilder application is minimized

  • Any keyboard activity when the PowerBuilder application
    is minimized and is current (its name is highlighted)

  • Any retrieval on a visible DataWindow that causes
    the edit control to be painted

    note.png Tip

    To capture movement, write script in the MouseMove or Key
    events of the window or sheet. (Keyboard activity does not trigger
    MouseMove events.) Disable the DataWindow control and tab ordering
    during iterative retrieves so the Idle timer is not reset.

Examples

This statement sends an Idle event after five minutes
of inactivity:

This statement turns off idle detection:

This example shows how to use the Idle event to stop
the application and restart it after two minutes of inactivity.
This is often used for computers that provide information in a public
place.

Include this statement in the script for the application’s
Open event:

Include these statements in the script for the application’s
Idle event to terminate the application and then restart it:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x