<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Richard Tartaglias wrote:
<blockquote
 cite="mid20050817073305.12409.qmail@web34115.mail.mud.yahoo.com"
 type="cite">
  <div>
  <div>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font size="3"><font
 face="Times New Roman">... <o:p></o:p></font></font></p>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font
 face="Times New Roman" size="3">The problem is I need to force and
export of data while still keeping track of where I am in the index or
from inside the get &#8220;getnext record &#8220; loop.</font></p>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font size="3"><font
 face="Times New Roman">&nbsp;<o:p></o:p></font></font></p>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font
 face="Times New Roman" size="3">I have a routine that prints the
letters using FilePro and the &#8220;FORM&#8221; command to force output but have
not found a command to force &#8220;export &#8221; within a getnext loop.</font></p>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font size="3"><font
 face="Times New Roman">&nbsp;<o:p></o:p></font></font></p>
  <p class="MsoNormal" style="margin: 0in 0in 0pt;"><font
 face="Times New Roman" size="3">Any suggestions.</font></p>
  </div>
  </div>
  <br>
</blockquote>
Hi Richard,<br>
I make use of the EXPORT command in just about every processing table I
have, so I'll share my observations.&nbsp;&nbsp; Unlike the FORM command, which
causes record data to be written to an output format buffer and flushed
each time it is called, the EXPORT command simply instantiates a named
buffer along with the method used for delimiting the data.&nbsp;&nbsp; In order
to populate the named buffer, you have to copy data to it as in
"buffer(1)=aa; buffer(2)=ab; buffer(3)=ac;" etc.&nbsp;&nbsp; It is not until
processing ends for the "current" record that all populated buffers are
flushed to their target I/O stream.&nbsp;&nbsp; Every place in filePro that I've
needed to force a buffer flush explicitly, I have used the WRITE
command (with the name of the buffer as a parameter) pretty
successfully.&nbsp;&nbsp; Whether the named buffer is from a LOOKUP, EXPORT, or a
FileI/O command, "write bufname" seems to flush it out.&nbsp;&nbsp; A code
fragment might look as follows:<br>
<br>
<tt>&nbsp;&nbsp;&nbsp; :<br>
&nbsp;&nbsp;&nbsp; : export ascii mybuf=/tmp/names.csv r=\n f=,<br>
- - - - -<br>
&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'output header row (if desired)<br>
&nbsp;&nbsp;&nbsp; : mybuf(1)="First Name"; mybuf(2)="Last Name"; write mybuf<br>
</tt><tt>- - - - -</tt><br>
<tt>&nbsp;&nbsp;&nbsp; :<br>
&nbsp;&nbsp;&nbsp; : lookup names&nbsp; k=1&nbsp;&nbsp; i=a -nx<br>
</tt><tt>- - - - -</tt><br>
<tt>loop: not names<br>
&nbsp;&nbsp;&nbsp; : goto done<br>
</tt><tt>- - - - -</tt><br>
<tt>&nbsp;&nbsp;&nbsp; : names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'output data row for each lookup
record found<br>
&nbsp;&nbsp;&nbsp; : mybuf(1)=names(1) ; mybuf(2)=names(2) ; write mybuf<br>
</tt><tt>- - - - -</tt><br>
<tt>&nbsp;&nbsp;&nbsp; :<br>
&nbsp;&nbsp;&nbsp; : getnext names ; goto loop<br>
</tt><tt>- - - - -</tt><br>
<tt>done:<br>
&nbsp;&nbsp;&nbsp; : .... <br>
<br>
</tt>Hope that is useful to you...<br>
<br>
Doug Campbell<br>
Yes! Tech Today, Inc.<br>
<br>
</body>
</html>