出于学习目的,我正在尝试以下方法:
我试图通过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.
答案 0 :(得分:0)
您可以通过使用可变行号定义要在屏幕部分中显示的行来实现此目的,该行号本身在工作存储中单独定义。
使用循环,在程序分区中,您可以通过向行变量添加1来显示每一行,显示该行,然后重复。