|
From: | Joe Robbins |
Subject: | [open-cobol-list] Newline on files produced by OpenCOBOL programs |
Date: | Fri, 20 Dec 2013 12:57:36 +0000 |
Hello Vincent
You wrote: << Please, please avoid changing the code that effects Line Sequential files that have LF/CR equivalents installed for Linux or Osx systems as all this does is create a blank line between each printed line and is very non standard.
I have been checking this and it appears:
1. OpenCOBOL fileio LINE SEQUENTIAL appends '\n' to each line written. It uses the standard fileio special characters - '\f' to throw the page, '\n' to advance a line, etc. Their is no alternative provision for WIN32, etc in the code. I know this results in 0x0a (LF) when running on LINUX. I expect that when run on Windows, 0x0d0a (CR + LF) - but I haven't checked this yet. The only reference to '\r' I can find is to skip or ignore it when reading LINE SEQUENTIAL.
2. I have just re-run the SQ section of the COBOL85 ANSI test suite for OpenCOBOL and Micro Focus, both on LINUX platforms. On Micro Focus every line in ALL logs has a CR. So for example when viewing with "vi" any log file, you see ^M displayed at the end of each line. I don't know whether this is configurable in Micro Focus.
3. Most print drivers, utilities etc will handle either convention: CR + LF and LF. So I am not sure why this becomes an "issue".
I think I remember you saying you had patched OpenCOBOL to fix this problem. Any code fragments illustrating what you fixed would help me double check fileio is now OK.
Regards: Joe Robbins
Joe Robbins |
[Prev in Thread] | Current Thread | [Next in Thread] |