Using WRITE() on 5.0 - running on Linux

Nancy Palmquist nlp at vss3.com
Thu Jun 25 13:46:30 PDT 2009


Bruce Easton wrote:
> Bruce Easton wrote Thursday, June 25, 2009 4:28 PM
>   
>> Nancy Palmquist wrote Thursday, June 25, 2009 3:43 PM:
>>     
>>> 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
>>     
>> Nancy, the only thing I can think of that would cause @wbrk 
>> to fire off multiple times would be if the field that is 
>> defined on the output format (or overridden from sel prc?) is 
>> an associated field.
>>
>> Bruce
>>     
>
> And I should have made clear - where the associated group 
> identifier is used in the sorting specification for the 
> output format.
>
>   
Bruce,

I could certainly understand that, but alas, no associated fields.  
Using the debugger, shows it is not firing off more than once.

On line 82 I have no ending yet.  On line 84, I have 4 closing tags.  It 
never processes it more than once.  I gave it limits by adding the last 
parameter to the WRITE() or WRITELINE() items.

Good suggestion.  My clearing of the variable ofile was to insure that I 
got past the logic that assigned the next output filename before I 
processed the end tags.  It eased my mind that it was not somehow 
running the @wbrk2 without running any detail section.

Thank you for the ideas.
Nancy
> Bruce
>
> Bruce Easton
> STN, Inc.
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>   


-- 
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