Importing into an empty file (was Re: ASCII Import)
Jay R. Ashworth
jra at baylink.com
Tue Jul 13 10:58:08 PDT 2004
On Tue, Jul 13, 2004 at 01:23:58PM -0400, Kenneth Brody wrote:
> "Shuman, Mike" wrote:
> > I am doing the Delete of all records and Import via a user menu.
> > If I use ddir to zero the file prior to running the import, don't I need
> > a dummy record to
> > stand on to do the import with free record lookup?
> > If so, how do I create this dummy record with out user involvement?
> [...]
>
> Assuming that you are within the file you are importing into (as opposed
> to posting to a different file), then you can do this even with no records
> in the file.
>
> Simply take your import routine from output processing, and place it in an
> input table under the @MENU event. Then replace your END with EXIT. When
> you run this process in *clerk, your import routine will be run when the
> @MENU event is triggered on startup (even with no records in the file),
> and your EXIT will exit *clerk after all the records have been imported.
>
> Because @MENU is not sitting on any record, there is no need to populate
> the file with a dummy record, as is needed when run from output processing.
Suggestion: since this is a useful programming pattern, and since it's
counterintuitive to do it from dclerk, could we get an @START for
dreport that fires in the same place? Or won't that work because,
finding no records in the file, dreport won't ever get that far?
Cheers,
-- jra
--
Jay R. Ashworth jra at baylink.com
Designer Baylink RFC 2100
Ashworth & Associates The Things I Think '87 e24
St Petersburg FL USA http://baylink.pitas.com +1 727 647 1274
"You know: I'm a fan of photosynthesis as much as the next guy,
but if God merely wanted us to smell the flowers, he wouldn't
have invented a 3GHz microprocessor and a 3D graphics board."
-- Luke Girardi
More information about the Filepro-list
mailing list