BR Versions 4.18j, 4.17o and I would suspect 4.2 has the same behaviour.
Open External - EOL=CRLF syntax allowed, but doesn't work.
Open #110: "NAME=File.dat,REPLACE,RECL=132,EOL=CRLF",External,Output
The BR Manual - does not list this Eol=CRLF parameter as being an option for opening External files, but this syntax is allowed.
To make it work, we added:
Let BL$=RPT$(" ",132) : Let BLK$=RPT$(" ",130)&CHR$(13)&CHR$(10) - added the Chr$(13)&Chr$(10) to the end of each record manually.
Suggestion:
1. Either make the EOL=CRLF work with External Files, and put in the CRLF automatically
or
2. Generate a syntax error when coding the Open statement.
This is deceiving and frustrating when testing new code.
File Open External, Ouput
Moderators: Susan Smith, admin, Gabriel
Since an EXTERNAL file, like an INTERNAL file is a fixed length record EOL is not needed and not implemented. EOL is only applicable to DISPLAY files that can have variable length records.
When writing to an external file, such as a NACHA banking file or a tax authority file that is supposed to be a text file I always open it EXTERNAL to two positions greater than the "required" file length. I then insert the data in each record with a final CRLF$ as follows:
01000 FRMXXX:Form c 20,zd 12.2,c 15.......,c 2
02000 write #XX,using FRMXXX:name$,amount,desc$,.......,crlf$
CRLF$ has been set to chr$(13)&chr$(10) by procing my TT file
I get your request however to pick up the EOL=something as an error on either entering the code or running the program as an error in open statement. It would highlight that something is wrong with the syntax.
FNGeorge
When writing to an external file, such as a NACHA banking file or a tax authority file that is supposed to be a text file I always open it EXTERNAL to two positions greater than the "required" file length. I then insert the data in each record with a final CRLF$ as follows:
01000 FRMXXX:Form c 20,zd 12.2,c 15.......,c 2
02000 write #XX,using FRMXXX:name$,amount,desc$,.......,crlf$
CRLF$ has been set to chr$(13)&chr$(10) by procing my TT file
I get your request however to pick up the EOL=something as an error on either entering the code or running the program as an error in open statement. It would highlight that something is wrong with the syntax.
FNGeorge