export question
Roger Cornelius
rac at custom-mobility.com
Mon Nov 1 12:18:28 PST 2004
On Sat Oct 30 19:22, Jeff Harrison wrote:
>
> --- Roger Cornelius <rac at custom-mobility.com> wrote:
>
> > On Fri Oct 29 14:57, Jeff Harrison wrote:
> > >
> [snip]
> > > ::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?
> >
>
> The "export" line should be executed before the
> assignments are made. You can think of the export
> line as being similar to a free record lookup.
> Executing that statement creates a blank record - you
> would then do the assignments to populate the record.
> In my example I included the "write" statement out of
> habit because I often use @menu processing for
> exports. When you do this you are not guaranteed that
> a write will occur unless you specifically execute the
> "write" command. However, if this were regular output
> processing (not "@" processing) then the write would
> occur automatically when the end statement was
> reached.
OK, thanks for clarifying.
> As I said, I have seen your technique where you
> execute a write instead of looping back on the export
> line. It seems counterintuitive to me, but apparently
> it works too.
It didn't for me. That's why I posted the question - I had tried that
and couldn't get it to work. The example I included in my initial
question, using multiple writes and a single, initial, call to "export"
wasn't functional. I was just throwing that out there as an example of
what I was trying to accomplish. The only way I was able to make it
work was to call "export" multiple times as you and Ken suggested.
Thanks.
--
Roger Cornelius rac at custom-mobility.com
More information about the Filepro-list
mailing list