Skip to main content

Dialog System, waiting 5 sec for input, then leaving the entry field, TIMEOUT

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

How can control be returned from a Dialog System Entry-Field after a specified time if the user does not input anything?

Resolution:

A TIMEOUT may be configured for this.

>>> TIMEOUT 500 NEXT

The second parameter of a timeout specifies the waiting time in hundredths of a second, after which the procedure defined by the third parameter is executed.

Here: "NEXT" is executed after 5.00 seconds

After the timeout occurs, please check, if there was a change on the entry-field.

If there was a change, do not leave the entry-field, because the user may just enter something.

Be aware, that programmed controls like a ListView, by default, do not cause a Lost-Focus-event for an Entry-Field. If the user can change to a programmed-control, please invoke its SET-FOCUS method to cause the LOST-FOCUS event for the entry-field.

-------------------------------------------------------

data fields

------------------------------------

EF2-MASTER                       X     10.0           

EF2-SAVE                             X     10.0           

EF2-TIMEOUT                      X      1.0           

Dialog of the entry-field

---------------------------------------

GAINED-FOCUS

     MOVE EF2-MASTER EF2-SAVE

     MOVE "N" EF2-TIMEOUT

     TIMEOUT 500 NEXT

   NEXT

     MOVE "T" EF2-TIMEOUT

* a "LOST-FOCUS" fills the masterfield,

* therefore Set-Focus to enforce a Lost-Focus.

* A different object may be used here,

* but cannot use the Windows/Dialog-Box,

* where the entry-field is placed on

     SET-FOCUS EF1

* here, an additional action may be added, like RETC

* or whatever should be done after the

* timeout period

LOST-FOCUS

     TIMEOUT 0 $NULL

     IF= EF2-TIMEOUT "T" LOSTFOCUS-BY-TIMEOUT

   LOSTFOCUS-BY-TIMEOUT

     IFNOT= EF2-MASTER EF2-SAVE EF2-GOON

   EF2-GOON

     SET-FOCUS EF2

Attachments:

time.gs

Old KB# 5188

0 replies

Be the first to reply!