Skip to main content

DISPLAY SPACE ... WITH ERASE EOL acts as WITH ERASE EOS

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

DISPLAY SPACE ... WITH ERASE EOL actually erases everything from its location to the end of screen, exactly the same behavior as using WITH ERASE EOS.

Resolution:

This is not a bug.

Look at the "DISPLAY statement" topic in the documentations, and you will be able to see the following note under Format 3 in clause #21:

"If the literal-1 is one of the following figurative constants it has a special effect as follows: SPACE clears from the specified cursor position to the end of the screen;" [...]"

If you look at the documentations, you will note the MF at the beginning of the clause. That is, the feature is an extension to ANSI 85 that is specific to Micro Focus COBOL. This also means that DISPLAY SPACE ... WITH ERASE EOL may in fact erase to the end of line in some other compilers.

You have then 3 alternatives to erase to the end of line:

replace the figurative constant SPACE with " ", or

replace the figurative constant SPACE with a variable that has the value of space(s), or

add the SIZE option from the WITH phrase option (see clause #22), i.e.  WITH ERASE EOL SIZE 1.

Old KB# 5286

0 replies

Be the first to reply!