header records on an export file
Brian K. White
brian at aljex.com
Tue Sep 21 10:13:51 PDT 2004
Richard D. Williams wrote:
> Rick,
>
>
> Turn your export into a gosub routine.
> Set a control var for the first line. This will allow you to make a
> frist line different then the rest.
> Make your first line:
> If :x eq ""
> Then:z="ia,8,password";x(1,,g)="x";gosub wrtout
>
> Continue your regular programming.
That only works if he doesn't let filepro provide the commas and every line
is one big Z field.
I'd use two different export commands, and have the first one do the header
and the second one do the rest, and the second one includes the append
switch.
4.8 doesn't have @once so you have to set a flag to do the header like you
showed.
I just watch some existing variable if present, such as shown here:
-------top------
if: ef eq ""
then: gosub header
if: '**** data ****
then: export word csv = (ef) -a
[existing export logic starts here]
if:
then: csv(1) = 1
if:
then: csv(17) = 17
[existing export logic ends here]
if:
then: end
header: if '**** header ****
then: ef(255,*,g) = "/edi/thefile.txt"
if:
then: export word hdr = (ef)
if: ' company code
then: hdr(1) = "ia"
if: ' # of records
then: hdr(2) = "8"
if: ' password
then: hdr(3) = "password"
if:
then: close hdr
if:
then: return
-------bottom-------
More information about the Filepro-list
mailing list