Copy to command from empty record set - bug or by design?
Bruce Easton
bruce at stn.com
Tue Jan 23 15:00:35 PST 2007
Tyler wrote January 23, 2007 5:34 PM:
> I can't tell if this is a bug in filePro or not - anyone know?
>
> I have some code with insufficient error checking that produced an
> interesting result. In some input processing, I have a lookup that
> fails (the qualifier has no records in it). I then get a free record
> from another qualifier, and copy the (failed!) lookup to it.
> Shouldn't this error out at this point? Instead, I get a record full
> of 0x00 characters (with some occasional weird non-nulls).
>
> prc.temp
> ================
> ::end:
> @keyM:::
> ::lookup rweb = kinotox k=1 i=A -npx:
> ::lookup live = kinotox at hh r=free -e:
> ::copy rweb to live; write live:
> ::msgbox ""{(live(@RN)):
> ::end:
>
> command
> ================
> /appl/fp/rclerk invhead -s1 -u -m rweb -y none -z temp
>
>
> Tyler Style
Tyler, you say that the key "kinotox at rweb" has no records in it. Try
rebuilding your index A - maybe it got corrupted and IT thinks there are
records still in the file. Also, I'm not sure if it would be a problem, but
I'm pretty sure I've always tried to stay clear from using the same alias
name ("rweb") as qualifier name (that you have on your command line) - maybe
that is causing some confusion for filepro.
Also, even if filepro had a problem with the copy command, I consider the
code to be inadequate since it does not test "not <lookup>" right after the
lookup that has the -n flag on it saying that filepro will not handle the
error.
In other words, your first lookup needs to tell the program what to do if
the lookup fails. the free record lookup doesn't need it since you are
letting filepro handle the error via the -e flag.
So you need something like:
::lookup rweb = kinotox k=1 i=A -npx:
:not rweb:goto errhnd1: 'do something where you will no
'longer reference the failed lookup alias.
::lookup live . . . .
Bruce Easton
STN, Inc.
More information about the Filepro-list
mailing list