File Open External, Ouput

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
dmeenen
Posts: 50
Joined: Mon Jun 08, 2009 8:34 pm
Contact:

File Open External, Ouput

Post by dmeenen »

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.
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

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
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Post by gordon »

Both of you are correct. This bug will be fixed in 4.2.

I will discuss this with Dan and report back.
Post Reply