<!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 “getnext record “ loop.</font></p>
<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">I have a routine that prints the
letters using FilePro and the “FORM” command to force output but have
not found a command to force “export ” within a getnext loop.</font></p>
<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">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. 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. 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. It is not until
processing ends for the "current" record that all populated buffers are
flushed to their target I/O stream. 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. Whether the named buffer is from a LOOKUP, EXPORT, or a
FileI/O command, "write bufname" seems to flush it out. A code
fragment might look as follows:<br>
<br>
<tt> :<br>
: export ascii mybuf=/tmp/names.csv r=\n f=,<br>
- - - - -<br>
: 'output header row (if desired)<br>
: mybuf(1)="First Name"; mybuf(2)="Last Name"; write mybuf<br>
</tt><tt>- - - - -</tt><br>
<tt> :<br>
: lookup names k=1 i=a -nx<br>
</tt><tt>- - - - -</tt><br>
<tt>loop: not names<br>
: goto done<br>
</tt><tt>- - - - -</tt><br>
<tt> : names 'output data row for each lookup
record found<br>
: mybuf(1)=names(1) ; mybuf(2)=names(2) ; write mybuf<br>
</tt><tt>- - - - -</tt><br>
<tt> :<br>
: getnext names ; goto loop<br>
</tt><tt>- - - - -</tt><br>
<tt>done:<br>
: .... <br>
<br>
</tt>Hope that is useful to you...<br>
<br>
Doug Campbell<br>
Yes! Tech Today, Inc.<br>
<br>
</body>
</html>