Question Timeout On Update

KMoody

Member
Code:
repeat:
    update block GO-ON(F5 PF4 F4) WITH FRAME setup4.

    IF LASTKEY=KEYCODE("F5") THEN LEAVE.
    IF LASTKEY=KEYCODE ("PF5") THEN LEAVE.
    IF LASTKEY=KEYCODE("F4") OR
        LASTKEY=KEYCODE("PF4") OR
        LASTKEY=KEYCODE("ESC") THEN LEAVE.
END.

Is there an easy way to force the program to "GO" if the user fails to update "block" within a set amount of time? I'm thinking of something like "READKEY PAUSE 2" except with "UPDATE."
 

TomBascom

Curmudgeon
You could always use read key inside an EDITING block.

I think I may need to surrender my programming license.
 

TheMadDBA

Active Member
RuLJktx.jpg
 

TheMadDBA

Active Member
You can choose to use EDITING, but it would be far easier to use some of the more modern techniques. Unless you are the only person that will ever touch the code. Most Progress developers will have never known the joys of using EDITING and CHOOSE.
 

TomBascom

Curmudgeon
"joys"

EDITING blocks (and CHOOSE) are officially "deprecated".

That means that Progress' official advice is "don't use them!".
 

TheMadDBA

Active Member
But remember how cool they were when they first came out?

Also using put screen and overlay frames to make menu bars and three-d popups :)
 

KMoody

Member
The EDITING block works like a charm, and it's easy to add it to existing code.

Just for reference, this is what I did:

Code:
DEFINE VARIABLE workno AS INTEGER.
REPEAT:
    UPDATE workno AT 1 GO-ON(ESC F4)
        WITH NO-LABELS NO-UNDERLINE NO-BOX FRAME c
        EDITING:
            READKEY PAUSE 120.
            IF LASTKEY = -1 OR LASTKEY = KEYCODE("F4") OR LASTKEY = KEYCODE("ESC") THEN
            DO:
                LAST-EVENT:SET-LASTKEY(0, KEYCODE("F4")).
                LEAVE.
            END.
            ELSE
                APPLY LASTKEY.
        END.
    IF LASTKEY = KEYCODE("F4") OR
        LASTKEY = KEYCODE("ESC") THEN
        LEAVE.
END.
 

TheMadDBA

Active Member
Newsflash: Tom Bascom encourages developers to use deprecated language functions, says work tables are better than temp tables.

Film at 11.
 

Cringer

ProgressTalk.com Moderator
Staff member
Newsflash: Tom Bascom encourages developers to use deprecated language functions, says work tables are better than temp tables.

Film at 11.
I'm looking forward to the SQLsequel: If your icode isn't nested to 10 levels it's not worth having.
 
Top