在 RPGLE 显示文件中按 Enter 键移动到下一个输入字段
我是 rpgle 编程新手。我想通过按 Enter 键(不按 Tab 键)将光标从一个整数输入字段移动到下一个整数输入字段,而不清除 rpgle display file。 请帮忙。提前致谢。
I am new to rpgle programming. I want to move the cursor from one integer input field to the next integer input field by pressing Enter key (without pressing the tab key) without clearing previously entered data in the rpgle display file.
Plz, help. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你真的不能那样做。
5250 协议是面向块/屏幕的协议。这意味着一旦屏幕被发送到设备,服务器就会脱离画面,直到设备返回控制权。
Enter
是一个特殊的键,它的唯一作用是将控制权返回给服务器。早在 5250 模拟器首次问世时,PC
Enter
默认映射到Field-Exit
键,右下角Ctrl
键映射到Enter
,因为这就是物理 5250 键盘上相应按键的位置。现在,IBM 的 ACS 模拟器使用Enter
来表示Enter
,使用Ctrl+Enter
来表示Field-exit
。Field-exit
是您正在寻找的行为。您可以像 @nfgl 在评论中提到的那样,模拟您希望用户实现的行为。您可以使用 RTNCSRLOC 以便您的程序知道按下 Enter 键时用户光标所在的位置,然后您的程序使用 DSPATR(PC) 或 CSRLOC 将光标放在下一个字段上,然后再发送屏幕返回设备。您的程序还需要保留先前输入的数据。例如,您的字段需要是输入输出,而不是仅输入字段。并且您需要确保在将其发送回之前不清除显示记录。
You really can't do that.
The 5250 protocol is a block/screen oriented protocol. Meaning that once a screen is sent to a device, the server is out of the picture till the device returns control.
Enter
is a special key, it's only job is to return control to the server.Way back when 5250 emulators first came out, the PC
Enter
by default mapped to theField-Exit
key and the lower rightCtrl
key mapped toEnter
as that's where those corresponding keys on a physical 5250 keyboard were. Now-a-days, IBM's ACS emulator usesEnter
forEnter
andCtrl+Enter
forField-exit
.Field-exit
is the behavior you are looking for.You could as @nfgl alludes to in the comments, simulate the behavior you desire for the user. You can use RTNCSRLOC so that your program knows where the user's cursor was when enter was pressed, and then your program use DSPATR(PC) or CSRLOC to place the cursor on the next field before sending the screen back to the device. Your program would also need to the data previously entered is retained. So for example, instead of input-only fields, your fields would need to be input-output. And you'd need to be sure to not clear the display record before sending it back out.