export question
Roger Cornelius
rac at custom-mobility.com
Sat Oct 30 14:48:51 PDT 2004
On Fri Oct 29 14:57, Jeff Harrison wrote:
>
> --- Roger Cornelius <rac at custom-mobility.com> wrote:
>
> > dreport v 4.8.10D4 on SCO OSR5.0.7
> >
> > Is there a way to export more than one record for
> > each filepro record
> > selected in output processing? The manual says no.
> >
> > E.g.:
> > If:
> > Then: export WORD exp=(of)
> > If:
> > Then:
> > If:
> > Then: exp(2) = 2
> > If:
> > Then: write exp ' write first export rec
> > If:
> > Then: exp(1) = 3
> > If:
> > Then: exp(2) = 4
> > If:
> > Then: write exp ' write second export rec
> > If:
> > Then: end
> >
> >
> > Currently, I'm using multiple print statements to
> > accomplish this and
> > then running sed on the result to strip ^M and blank
> > lines.
> > --
>
> I'm not sure what you mean by multiple print
> statements - I guess you are using the print output
> then?
Yes, I was formatting a csv type record manually and then printing it.
> You certainly can export a selected record any number
> of times. I have seen it done the way you show above,
> but I don't use that approach. Here is how I would do
> it:
>
> ::ct="1":
> loop:::
> :ct gt "2":goto fini:
> ::export WORD exp=(of):
> ::exp(1)=1; exp(2)=2; write exp:
> ::ct=ct+"1"; goto loop:
> fini::end:
In my project, using a loop like this doesn't really fit, but I get the
idea. I'm a little confused though on the function of "write" here, and on
what order things occur in. In my reply to Ken, I included sample code
which works without using "write". Also, I set the export's field
values and then call the export. You're doing the reverse. Does
"export" write a record when it's called, but only if it's fields have
been modified?
More information about the Filepro-list
mailing list