在 RPGLE 显示文件中按 Enter 键移动到下一个输入字段

发布于 2025-01-15 18:00:21 字数 154 浏览 3 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独﹏钓一江月 2025-01-22 18:00:21

你真的不能那样做。

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 the Field-Exit key and the lower right Ctrl key mapped to Enter as that's where those corresponding keys on a physical 5250 keyboard were. Now-a-days, IBM's ACS emulator uses Enter for Enter and Ctrl+Enter for Field-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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文