File handler not appending to file

Brian K. White bw.aljex at gmail.com
Mon Sep 16 13:30:50 PDT 2019


On 9/16/19 4:02 PM, James Flanagan via Filepro-list wrote:
> 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")

right here insert a seek-to-end-of-file, which is done by seek() with 
arguments that mean seek to 0 bytes back from end of file.

x = seek(aa,"0","2")

> ::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>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list