Search code examples
openedgeprogress-4gl

Progress (sometimes) does not continue processing after switching windows


My program do the following steps:

  1. Program asks user to read a label (by using a 2D scanner).
  2. The program finds some informations about the label and opens a second window.
  3. In the second window, the user needs to read 4 more labels to compare against informations saved on database.
  4. The second window closes and returns an status saying if all the informations are good or not.
  5. If information is OK, continue processing. If not OK, returns to step 1.

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.


Solution

  • 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.