Doug Johnson
New Member
[Windows XP - Progress 91E]
Is there a way to switch between two different frames/programs and preserve the "state" of each so when the user returns to the previous frame, everything is as it was before leaving? In the example below, I would want the input to NOT copy over to the main program from the called program. We want the user to be able to "jump" out from what they are doing, look up some info in a different program and then return to exactly what they were doing without interruption. I thought it would be as easy as just hiding frames, but it doesn't seem to work that way.
PROGRAM 1:
PROGRAM 2
Is there a way to switch between two different frames/programs and preserve the "state" of each so when the user returns to the previous frame, everything is as it was before leaving? In the example below, I would want the input to NOT copy over to the main program from the called program. We want the user to be able to "jump" out from what they are doing, look up some info in a different program and then return to exactly what they were doing without interruption. I thought it would be as easy as just hiding frames, but it doesn't seem to work that way.
PROGRAM 1:
Code:
DEFINE VARIABLE x AS CHARACTER FORMAT "X(1)".
FORM "Scanning Menu1" AT 4.5 SKIP
"PROG1" AT 9 SKIP
"1. ONE" AT 6 SKIP
"2. TWO" AT 6 SKIP
"3. THREE" AT 6 SKIP
"Enter Choice" AT 4
x AT 17
WITH NO-BOX NO-LABELS NO-UNDERLINE ROW 1 FRAME setupa WITH BGCOLOR 8 SIZE 20 BY 8.
REPEAT:
HIDE ALL.
CLEAR ALL.
DISPLAY WITH FRAME setupa.
UPDATE x GO-ON(F5 F4 ESC) WITH FRAME setupa.
IF LASTKEY=KEYCODE("F5") THEN DO:
RUN I:\ITDATA\progress\Doug\outin2.p.
END.
IF LASTKEY=KEYCODE("F4") THEN LEAVE.
IF LASTKEY=KEYCODE("ESC") THEN LEAVE.
IF X = "1" THEN DISPLAY "ONE".
IF X = "2" THEN DISPLAY "TWO".
IF X = "3" THEN DISPLAY "THREE".
END.
Code:
DEFINE VARIABLE y AS CHARACTER FORMAT "X(1)".
FORM "Scanning Menu2" AT 4.5 SKIP
"PROG2" AT 9 SKIP
"4. FOUR" AT 6 SKIP
"5. FIVE" AT 6 SKIP
"6. SIX" AT 6 SKIP
"Enter Choice" AT 4
y AT 17
WITH NO-BOX NO-LABELS NO-UNDERLINE ROW 1 FRAME setupb WITH BGCOLOR 8 SIZE 20 BY 8.
REPEAT:
HIDE ALL.
CLEAR ALL.
DISPLAY WITH FRAME setupb.
UPDATE Y GO-ON(F4 ESC F5) WITH FRAME setupb.
IF LASTKEY=KEYCODE("F4") THEN LEAVE.
IF LASTKEY=KEYCODE("ESC") THEN LEAVE.
IF y = "4" THEN DISPLAY "FOUR".
IF y = "5" THEN DISPLAY "FIVE".
IF y = "6" THEN DISPLAY "SIX".
END.