My program do the following steps:
My issue is the following: sometimes after returning from Step 5, the main program won't continue processing the information. Requiring user to press ESC
on the keyboard.
(and this shouldn't be happening, since they don't have access to a physical keyboard)
This is the Main Program (Calling the 2nd):
(Attempt 1)
PROCEDURE Processa_Scan:
// More code here
RUN validate_data.w(INPUT txtscan:SCREEN-VALUE, OUTPUT lSeatOK).
IF NOT lSeatOK THEN DO:
// Not valid
RETURN.
END.
// More code here
END.
(Attempt 2)
PROCEDURE Processa_Scan:
// More code here
IF NOT l-hasvalidseat THEN DO:
RUN validate_data.w(INPUT txtscan:SCREEN-VALUE, OUTPUT lSeatOK).
IF NOT lSeatOK THEN DO:
// Not valid
RETURN.
END.
L-hasvalidseat = TRUE.
RUN Processa_Scan.
RETURN.
END.
// More code here
END.
In the Validate_Data.w, this is what I do when closing the program:
DO:
// lStatus is the OUTPUT parameter
lStatus = TRUE.
APPLY "CLOSE" TO THIS-PROCEDURE.
END.
EDIT 1:
We have made a few tests, and the application keeps freezing by about 3 minutes and return scanning again... Keeping freezing every time after the first one.
So... After a couple of weeks of try and error I couldn't find the error.
What I did that solve the issue was to get all components from Validate_Data.w and added as a new frame in the main program.
And switched the calling method to:
cScan = txtscan:SCREEN-VALUE IN FRAME DEFAULT-FRAME.
VIEW FRAME FRAME-VALIDATESEAT.
RUN Create_TempTable.
APPLY "ENTRY" TO FILL-IN-1 IN FRAME FRAME-VALIDATESEAT.
WAIT-FOR "GO" OF FRAME FRAME-VALIDATESEAT.
By using this, I can make the program waits for the frame to close before continuing processing the informations.