Microsoft KB Archive/39194

DISPLAY (LIN, COL) ERASE Needs MS(2) Directive in COBOL 3.0

PSS ID Number: Q39194 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: When you are converting programs from Microsoft COBOL Version 2.x to Microsoft COBOL Version 3.0, you may notice that the DISPLAY statement reference in the “Microsoft COBOL Compiler Version 3.0: Language Reference Manual” does not state that the ERASE option is valid. ERASE is a valid option for the DISPLAY statement in COBOL Version 3.0 only if the MS(2) compiler directive is specified. ERASE does not support the REVERSE-VIDEO attribute; this is a Version 3.0 limitation.

More Information: The following additional DISPLAY statement format should be added to the “Microsoft COBOL Compiler Version 3.0: Language Reference Manual”, starting on Page 15-54: DISPLAY (position-spec) ERASE. -or- | (literal, literal) | DISPLAY | (LIN, COL) | ERASE. | (LIN +/- literal, COL +/- literal) | When using the DISPLAY position-spec with the ERASE option, the cursor is positioned at the specified location on the screen, and the screen contents below are erased. If data is to be displayed at the same time, the screen is first cleared and the values are displayed starting at the specified cursor position. If the ERASE option is used and no cursor position has been specified in the display statement, no action will be taken. The following is a code example: Working-Storage Section. 77 push-key pic x(01). Procedure Division. perform Display-Text. accept push-key. display (9, 9) ERASE. accept push-key.   Option using no cursor locations - no effect '' perform Display-Text. accept push-key. display ERASE. accept push-key. stop run. '' Display-Text. display (10,10) “This should appear on screen”.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.