How do I force export from within a loop

Kenneth Brody kenbrody at bestweb.net
Wed Aug 17 15:08:57 PDT 2005


Quoting Brian K. White (Wed, 17 Aug 2005 16:56:08 -0400):
[...]
> > This is not correct. If Stuart has explained it that way in his book,
> > no matter how many times he's reprinted it, he's still wrong. A WRITE
> > will in no way export a line to an export file. Unless, the EXPORT
> > line itself is within the loop (getnext or any other kind of loop
> > which gets successive records) nothing will be added to the export
> > file. So, unless you mean something else, or Stuart explained it some
> > other way, this is just not > correct.
[...]
> Sure it will. As long as you allow that he might have meant write().

WRITE() won't work without an open file handle from OPEN() or CREATE().
It won't work with EXPORT, which is what we're talking about here.

>
> Looking up the page in the stn book that he referenced would have shown
> if he was talking about the file i/o write() command, which might have
> avoided falsely accusing both Mike and Stuart of being wrong. I don't
> have that book handy so I can't say that he was talking about the file
> i/o command or the commit-lookup-now command.
[...]
> And even if it _did_, since he also said "I have proven code I can show
> you", it's kind of dumb to say "that's wrong" before saying "show me".

Actually, it turns out you're both right.

WRITE will, in fact, write out an EXPORT file, _if_ you are in *report.
It will not do so in *clerk.  Why?  I can only guess.  My guess is that,
way back when, when IMPORT/EXPORT were not part of clerk's vocabulary,
it obviously made sense that clerk wouldn't allow "WRITE exportname".
Way back when, when dclerk was created, and allowed IMPORT/EXPORT, the
filePro engine wasn't changed, and WRITE still only works in *report.

However, since the documented way of doing multiple exports is to
execute the EXPORT more than once, rather than WRITE, no one noticed
until 15+ years later.

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list