Consultor Eletrônico



Kbase 13843: How to find idle users - no recent screen interaction
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
How to find idle users - no recent screen interaction

INTRODUCTION:
============
This PROGRESS Software Technical Support Knowledgebase
entry contains sample code.

WHY YOU NEED TO DO THIS:
=======================
If you need to keep the clock 'ticking' on a screen even if
the user is idle, then this code sample may provide you with
a good starting point. However, it is up to you, the
programmer, to test and modify to your needs.

Note that the '900' value in the code was chosen to force
the application to take an action if, after 15 minutes
(900/60), there is no keyboard activity.

PROCEDURAL APPROACH:
===================
DEF VAR myvar AS CHAR.
DEF VAR dur AS INT NO-UNDO.
DEF VAR nokey AS INT NO-UNDO.
DEF VAR start AS INT FORMAT "9999" NO-UNDO.
DO WHILE TRUE:
IF dur = 0 THEN ASSIGN start = (TIME - 60).
IF dur <> 0 THEN DISPLAY dur LABEL "Elapsed Time".
UPDATE myvar EDITING:
ASSIGN dur = (TIME - start) / 60.
DISPLAY dur LABEL "Elapsed Time".
READKEY PAUSE 3.
DO:
IF LASTKEY = -1
THEN DO:
ASSIGN nokey = nokey + 3.
IF nokey > 900 THEN DO:
BELL.
MESSAGE "No entry detected for 15 minutes".
END. /* nokey > 900 */
END. /* lastkey = -1 */
ELSE DO:
ASSIGN nokey = 0.
APPLY LASTKEY.
END. /* lastkey <> -1 */
END. /* do */
END. /* editing */
END. /* do */

REFERENCES TO WRITTEN DOCUMENTATION:
===================================

PROGRESS Language Reference Manual.

Progress Software Technical Support Note # 13843