Lookup Question
Jeff Harrison
jeffaharrison at yahoo.com
Thu Mar 2 21:00:11 PST 2006
--- Art Moore <cowboy at pcanswersinc.com> wrote:
> I hope my question isn't too simple making every
> pass it by.
>
> I am using filePro 5.0.05 on an XP system.
>
> I am trying to do a lookup that I know should be
> water off a ducks back,
> but.... I want the lookup to read a field in the
> current file (ACTIVITY)
> and match it to a corresponding field in a MASTER
> file. If there is a match
> then data from the ACTIVITY file along with data
> from the MASTER file is
> written to a third FINAL file. I have made the
> lookup work but it always
> ended with an error message because I know I am not
> ending things properly.
> But, it worked and in my application I was able to
> live with the error
> message.
>
> But, now I would like the lookup to do a SHOW when
> the ACTIVITY file has a
> number that does not show up in the MASTER file.
> The SHOW should stop and
> display the number that is not found in the MASTER
> file and then when I hit
> enter continue on.
>
> I guess it would be nice that when the file finishes
> if it would not end up
> with the error message also.
>
> I am using the following code:
>
> then: LOOKUP mas=MASTER k=6 i=A -nx
> if: mas(1) ne 6
> then: GOSUB nonum;END
[snip]
I think that your problem is simply that you are not
checking for a failed lookup. If the lookup fails -
ie there is no match, then the following line in your
sample code would give an error as you have it. Here
is an example of how you can check for lookup failure,
and take appropriate action.
::lookup mas = MASTER k=6 i=a -nx
:not mas:gosub nonum; end:
I hope that helps. Good Luck.
Jeff Harrison
jeffaharrison at yahoo.com
Author of JHExport and JHImport. The easiest and
fastest ways to generate code for filePro exports and
imports.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Filepro-list
mailing list