File handler not appending to file
James Flanagan
James at Flantec.com
Mon Sep 16 13:02:29 PDT 2019
Filepro 5.7.00.09D4
FreeBSD 10.3
I have used filepro’s file handlers (open, writeline, and close) many times successfully, but always as a one stop shop for the file creation.
Now, I want to (if possible) use these same functions in a dreport where it would append the file with another line for each record processed, but presently, each iteration overwrites the existing line with its single output line, despite using the “0”, which according to the manual “0 - truncate if already exists” .
Up until now, I have been using system commands and elaborate echo commands, but the data is getting filled with some characters that are problematic without having to encapsulate in single quotes, etc.
Below is a sample where I would expect /tmp/test to have 9 lines, numbered 1-9 when complete, but Instead only has the last iteration of the loop saved to line #1 of the file.
@wef1::':
::fi="/tmp/test":
::li="1":
loop::':
::aa=open(fi,"rwc0")
::ab=writeline(aa,li):
::ac=close(aa):
::li=li+"1":
:li lt "10":goto loop:
::end:
Please let me know if this can be done. Thank you.
James Flanagan
Flantec.com <http://flantec.com/>
email: James at Flantec.com <mailto:James at Flantec.com>
mobile: 760-458-8498
home: 219-221-6219
text: 7604588498 at txt.att.net <mailto:7604588498 at txt.att.net>
Skype: Flantec
ichat: James at Flantec.com <mailto:James at Flantec.com>
home: 1901 Cidermill Road
Michigan City, IN 46360
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20190916/9106fc28/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 19328 bytes
Desc: not available
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20190916/9106fc28/attachment.tiff>
More information about the Filepro-list
mailing list