如何在 COBOL 的 SCREEN SECTION 中显示表格?

发布于 2024-08-21 13:05:42 字数 903 浏览 5 评论 0原文

出于学习目的,我正在尝试以下操作: 我正在尝试通过 COBOL 显示表格...我想定义它在 SCREEN SECTION 中的显示方式。

以下发生或应该发生 - 所有这些都无需打开多个屏幕:

(1) User enters ENTRY-SCREEN
(2) User has to type in a password (nothing happens there yet ... I am going   
    step by step)
(3) User hits ENTER and gets to the MAIN MENU
    (3.1) User hits "D" --> List of states and abbreviations is displayed
    (3.2) User hits "S" --> User gets to screen where he can look up state-name  
          by entering abbreviation.
(4) By pressing F2 the user can go back to the MAIN MENU
(5) By pressing F1 the user can exit the program

我的问题是 3.1,无需打开新屏幕,也无需为每个状态定义行和列定义。 有没有一种方法 - 也许使用循环或使用 THRU - 使这更容易,甚至可以在屏幕部分中定义它? 喜欢:

PERFORM VARYING counter FROM 1 BY 1 UNTIL counter > 50
*<Display the abbreviation and state-name w/o opening new screen>
END-PERFORM.

For learning purposes I am trying the following:
I am trying to display a table via COBOL ... I want to define the way it is all displayed in the SCREEN SECTION.

Following happens or is supposed to happen - all without multiple screens opening:

(1) User enters ENTRY-SCREEN
(2) User has to type in a password (nothing happens there yet ... I am going   
    step by step)
(3) User hits ENTER and gets to the MAIN MENU
    (3.1) User hits "D" --> List of states and abbreviations is displayed
    (3.2) User hits "S" --> User gets to screen where he can look up state-name  
          by entering abbreviation.
(4) By pressing F2 the user can go back to the MAIN MENU
(5) By pressing F1 the user can exit the program

My problem is 3.1 without opening a new screen and without having to define a line and column definition for each state.
Is there a way - maybe with a loop or with THRU - to make this easier and maybe even define this in the screen section?
Like:

PERFORM VARYING counter FROM 1 BY 1 UNTIL counter > 50
*<Display the abbreviation and state-name w/o opening new screen>
END-PERFORM.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

玩套路吗 2024-08-28 13:05:42

您可以通过使用可变行号定义要在屏幕部分中显示的行来实现此目的,该行本身是在工作存储中单独定义的。

使用循环,在过程部分中,您可以通过向行变量添加 1 来显示每一行,显示该行,然后重复。

You can do this by defining the line to be displayed in the Screen Section with a variable line number, which itself is defined separately in working-storage.

Using a loop, in the procedure division, you can display each line by adding 1 to your line variable, display the line, and repeat.

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