所以我正在尝试制作一个类似表单的屏幕,用户可以在其中输入他的数据并将其保存在 .txt 文件中。我正在使用 OpenCobolIDE,目前在清除屏幕过程中遇到问题。我有一种我在控制台屏幕上制作的表格,当用户输入他的数据时,我会用变量的新值刷新它,但是光标位置让我搞砸了,因为在我清除屏幕后它被重置为控制台屏幕的开头,我希望它转到我在此过程之后显示的文本的末尾。我的解释可能看起来令人困惑,但我希望你能理解我的代码:
IDENTIFICATION DIVISION.
PROGRAM-ID.PGM001.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-DATA
02 WS-ID PIC X(03) VALUE SPACES.
02 WS-NAME PIC A(15) VALUE SPACES.
02 WS-PHONE PIC X(09) VALUE SPACES.
SCREEN SECTION.
01 CLEAR-SCREEN.
02 BLANK SCREEN.
PROCEDURE DIVISION.
MENU.
DISPLAY "ID........:" WS-ID.
DISPLAY "NAME......:" WS-NAME.
DISPLAY "PHONE.....:" WS-PHONE.
DISPLAY "-----------".
DISPLAY "ID:".
ACCEPT WS-ID FROM CONSOLE.
DISPLAY CLEAR-SCREEN.
DISPLAY "ID........:" WS-ID.
DISPLAY "NAME......:" WS-NAME.
DISPLAY "PHONE.....:" WS-PHONE.
DISPLAY "-----------".
DISPLAY "NAME:".
ACCEPT WS-NAME FROM CONSOLE.
DISPLAY CLEAR-SCREEN.
DISPLAY "ID........:" WS-ID.
DISPLAY "NAME......:" WS-NAME.
DISPLAY "PHONE.....:" WS-PHONE.
DISPLAY "-----------".
DISPLAY "PHONE:".
ACCEPT WS-PHONE FROM CONSOLE.
DISPLAY CLEAR-SCREEN.
DISPLAY "ID........:" WS-ID.
DISPLAY "NAME......:" WS-NAME.
DISPLAY "PHONE.....:" WS-PHONE.
DISPLAY "-----------".
STOP RUN.
END-PROGRAM PGM001.
所以你会注意到我一直在清除屏幕并在表单中显示,但是当我这样做时,光标会转到屏幕的开头,我无法继续输入数据。有人能帮助我吗?cobol中有没有移动光标的命令?