进度(有时)在切换窗口后不会继续处理。

huangapple go评论50阅读模式
英文:

Progress (sometimes) does not continue processing after switching windows

问题

  1. 我的程序执行以下步骤:

    1. 程序要求用户使用2D扫描器读取一个标签。
    2. 程序查找关于标签的一些信息并打开第二个窗口。
    3. 在第二个窗口中,用户需要读取另外4个标签以与保存在数据库中的信息进行比较。
    4. 第二个窗口关闭并返回一个状态,指示所有信息是否正确。
    5. 如果信息正确,则继续处理。如果不正确,则返回到步骤1。
  2. 我的问题是:有时在从步骤5返回后,主程序不会继续处理信息。需要用户在键盘上按下ESC

    (而这不应该发生,因为他们没有物理键盘可供使用)

  3. 这是主程序(调用第二个):

    (尝试1)

    PROCEDURE Processa_Scan:
    
         // 更多代码在这里
    
         运行 validate_data.w(输入 txtscan:SCREEN-VALUE, 输出 lSeatOK).
         如果 不 lSeatOK 那么 做:
             // 无效
             返回.
         结束.
    
         // 更多代码在这里
    
    结束.
    
    

    (尝试2)

    PROCEDURE Processa_Scan:
    
         // 更多代码在这里
    
           如果 不 l-hasvalidseat 那么 做:
    
                 运行 validate_data.w(输入 txtscan:SCREEN-VALUE, 输出 lSeatOK).
                 如果 不 lSeatOK 那么 做:
                     // 无效
                     返回.
                 结束.
                 L-hasvalidseat = TRUE.
                 运行 Processa_Scan.
                 返回.
    
           结束.
    
         // 更多代码在这里
    
    结束.
    
    
  4. Validate_Data.w中,当关闭程序时我会执行以下操作:

    做:
        // lStatus 是输出参数
        lStatus = TRUE.
        应用 "CLOSE" 到 此过程.
    结束.
    

编辑1:

我们进行了一些测试,应用程序每次在第一次之后都会冻结大约3分钟,然后重新开始扫描... 在第一次之后每次都会冻结。

英文:

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.<br>
(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 &quot;CLOSE&quot; 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.

答案1

得分: 0

So... 在经过几周的尝试和错误后,我找不到错误。

我解决问题的方法是从 Validate_Data.w 中获取所有组件,并将其添加为主程序中的新框架。

然后切换调用方法为:

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.

通过使用这种方法,我可以让程序在继续处理信息之前等待框架关闭。

英文:

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 &quot;ENTRY&quot; TO FILL-IN-1 IN FRAME FRAME-VALIDATESEAT.
WAIT-FOR &quot;GO&quot; OF FRAME FRAME-VALIDATESEAT.

By using this, I can make the program waits for the frame to close before continuing processing the informations.

huangapple
  • 本文由 发表于 2023年5月10日 21:42:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76219176.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定