header records on an export file
Bob Stockler
bob at trebor.iglou.com
Tue Sep 21 10:52:22 PDT 2004
On Tue, Sep 21, 2004 at 01:13:51PM -0400, Brian K. White wrote:
| 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-------
I _think_ the -A switch works only with EXPORT ASCII.
My solution would be to build the lines by hand and use
EXPORT ASCII (in which case the -A wouldn't be needed).
Bob
--
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).
More information about the Filepro-list
mailing list