英文:
Progress (sometimes) does not continue processing after switching windows
问题
-
我的程序执行以下步骤:
- 程序要求用户使用2D扫描器读取一个标签。
- 程序查找关于标签的一些信息并打开第二个窗口。
- 在第二个窗口中,用户需要读取另外4个标签以与保存在数据库中的信息进行比较。
- 第二个窗口关闭并返回一个状态,指示所有信息是否正确。
- 如果信息正确,则继续处理。如果不正确,则返回到步骤1。
-
我的问题是:有时在从步骤5返回后,主程序不会继续处理信息。需要用户在键盘上按下
ESC
。(而这不应该发生,因为他们没有物理键盘可供使用)
-
这是主程序(调用第二个):
(尝试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. 返回. 结束. // 更多代码在这里 结束.
-
在Validate_Data.w中,当关闭程序时我会执行以下操作:
做: // lStatus 是输出参数 lStatus = TRUE. 应用 "CLOSE" 到 此过程. 结束.
编辑1:
我们进行了一些测试,应用程序每次在第一次之后都会冻结大约3分钟,然后重新开始扫描... 在第一次之后每次都会冻结。
英文:
My program do the following steps:
- Program asks user to read a label (by using a 2D scanner).
- The program finds some informations about the label and opens a second window.
- In the second window, the user needs to read 4 more labels to compare against informations saved on database.
- The second window closes and returns an status saying if all the informations are good or not.
- 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 "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.
答案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 "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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论