header records on an export file
Brian K. White
brian at aljex.com
Tue Sep 21 18:04:18 PDT 2004
verified that -a only works with ascii
verified that I was omitting r=\n from my previous example and it is
required if you want linefeeds between records
verified that if you only use one export command, or more accurately, one
_alias_, then the very first record printed has as many fields as the
longest record in the report. I tested this by removing the seperate export
from @once and replacing it with a "gosub exp" in @once, reverted gosub exp
to it's previous "export word csv=(@pm)" without any flags, and in @once I
only set csv(1) and csv(2), and in the main export body there is usually 42
fields, I added this line:
if: @rp eq "3"
then: csv(43)="field43"
so there is only one reference to any field over 42 and it is only
encountered on exactly one record and that record comes unambiguously after
@once and after 2 whole records have been processed and put to bed.
and the report came out with every record had 43 fields including the header
and the first 2 data records.
verified that if you use two different export commands, where:
* the 1st export can be of any type and style, it can be the simple
unadorned "export word" like I've been using, or it can be ascii with
completely different record and field delimiter flags, etc.
* the 2nd export is 'export ascii csv = (@pm) r=\n f=, o=" c=" -a'
* the two exports use different aliases (but the same filename)
* the alias for the first export is closed before the first time the 2nd
export is ever encountered
* don't need to sync or sleep or write etc just "close hdr"
* once the 2nd export is encountered, the 1st export command is never again
encountered nor any references to that alias.
Then you can create a header line (or lines) that are longer or shorter
than the following lines in the same file and it doen't cause any errors or
messages either at tokenize or run time.
I was using @once but it works the same using the alternate way of looking
at a global variable to sense the beginning of the report, so long as you
get it right and don't mess up and the first export really does run and
close before the main export ever
gets encountered by processing and the 1st export never again gets
encountered by processing.
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
More information about the Filepro-list
mailing list