Using WRITE() on 5.0 - running on Linux

Nancy Palmquist nlp at vss3.com
Thu Jun 25 12:43:19 PDT 2009


I have the craziest thing happening and wondered if anyone else ever saw 
this.

I have a report with 2 break points.

I open a file on a new account, create a header, then write detail lines 
on each record until the account number break hits (@wbrk2). When each 
detail line is written, I close the file. On the next record I run the 
openit routine, below to open the file, and then write the next detail 
record and close the file.

In the @wbrk2 logic, I open the file, move to the end and do the following:


I get the last write - 4 times.
</MetroIndex>


<?xml version="1.0" encoding="UTF-8" ?>
<MetroIndex><Account>M05798</Account>
<BuildDate>06/25/09</BuildDate>
<BuildTime>14:34:28</BuildTime>
<MetroDMV>
<ClaimNumber>08-5037933</ClaimNumber>
<RequestDate>10/20/2008</RequestDate>
<L_RequestDate>20081020</L_RequestDate>
</MetroDMV>
<MetroDMV>
<ClaimNumber>08-5037933</ClaimNumber>
<RequestDate>10/20/2008</RequestDate>
<L_RequestDate>20081020</L_RequestDate>
</MetroDMV>
</MetroIndex>
</MetroIndex>
</MetroIndex>
</MetroIndex>

SEE This silly repeated line at the end.

end
80 ------- - - - - - - - - - - - - - - - -
@wbrk2 ? If: ofile eq "" ?
Then: end ?
81 ------- - - - - - - - - - - - - - - - -
? If: 'end of customer index ?
Then: gosub openit ?
82 ------- - - - - - - - - - - - - - - - -
? If: ' was using the variable MyResult but removed that ?
Then: 'MyResult=letag{"MetroIndex>"{"" ?
83 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: aa=writeline(outhandle,letag{"MetroIndex>","13") ?
84 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: gosub clsit ?
85 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: madetop="N";Myresult="" ?
86 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: ofile="";htmfile="" ?
90 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: end
51 ------- - - - - - - - - - - - - - - - -
openit ? If: 'open the file for writing ?
Then: outhandle=open(ofile,"rwcb") ?
52 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: endofile=seek(outhandle,"0","2");return ?
53 ------- - - - - - - - - - - - - - - - -
clsit ? If: ?
Then: aa=close(outhandle);return

I have fussed with line 83, which did use WRITE() - but that did the 
same exact thing. I erased the filename
to be sure it would not run @wbrk2 for another account but write to this 
file.

Why am I getting 4 occurances of the WRITE in line 83?
Variables are all defined as
declare global ofile(60,,g), outhandle(8,.0,g), endoffile(8,.0,g)
declare Myresult


Feel free to ask questions if I have overlooked any info.
I just changed this from an export routine, because some lines were 
being truncated by the export limits. I figured this would fix that.

Nancy

-- 
Nancy Palmquist 		MOS & filePro Training Available
Virtual Software Systems	Web Based Training and Consulting	
PHONE: (412) 835-9417		   Web site:  http://www.vss3.com



More information about the Filepro-list mailing list