lookup -nl problem
GCC Consulting
gccconsulting at comcast.net
Sat Jun 6 11:53:16 PDT 2009
> -----Original Message-----
> From: filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com
> [mailto:filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com] On
> Behalf Of Laura Brody
> Sent: Friday, June 05, 2009 5:17 PM
> To: filepro-list at lists.celestial.com
> Subject: Re: lookup -nl problem
>
> Quoting Richard Kreiss <rkreiss at verizon.net>:
>
> > Fp 5.6.06 Windows
> >
> > I have an application process transactions. When run, it first
> > checks to see if the credit card being processed is the latest one
> > on file.
> >
> > Card file lookup sequence is "CC"&master_code*&"9". Nine is the
> > highest sequence #.
> >
> > Master code is nnnn-nnnnn
> >
> > 27 ------- - - - - - - - - - - - - - - - -
> > ◄ If: 'lookup on r_type = CC 7 master_code & sequence # of 9
> > Then: lv="CC"&master_code&"9"
> > 29 ------- - - - - - - - - - - - - - - - -
> > ◄ If:
> > Then: lookup card = l_card k=lv i=F -nl
> >
> > The problem is that the code does not get the highest sequence #
> > record put the prior on. i.e. 3 cards on file, finds card #2.
> >
> > I test this programming in clerk using a message box to display the
> > card found. My test in clerk was hardcoded with the master_code.
> > However this code found the proper record.
> >
> > 76 ------- - - - - - - - - - - - - - - - -
> > ◄ If:
> > ◄
> > Then: lv="CC"&master_code&"9" ◄
> > 77 ------- - - - - - - - - - - - - - - - -
> > ◄ If:
> > ◄
> > Then: lookup card = l_card k=lv i=F -nL
> > ◄
> > 78 ------- - - - - - - - - - - - - - - - -
> > ◄ If: NOT card
> > ◄
> > Then: BEEP;ERRORBOX "Credit Card Not Found";END
> > ◄
> > 79 ------- - - - - - - - - - - - - - - - -
> > ◄ If:
> > ◄
> > Then: msgbox card(3){"\nCard # is \r"<card(4)<"\nSeq
> > is \b2"<card(16)<"\a-"
> > 80 ------- - - - - - - - - - - - - - - - -
> > ◄ If:
> > Then: END
> >
> > Same code one in report and other in clerk. Anyone know a reason
> > why the report version fails and the clerk works?
>
>
> I would start off with double checking the type and length
> of your variables lv and master_code.
Laura,
Lv is uncast. Master_code (10,ccp) where ccp is defined as NNNN<->NNNNN
If I cast lv it would have to be 2+10+1 or 13 lv(13,*) as Ken has told me this becomes a literal string and the numeric values at not considered as numbers. Is would assume(bad word) the lv="CC"&NNNN-NNNNN&"9" would have lv as a 13 character value.
Since lv is the same uncast value in both clerk and report, they should yield the same result.
Richard
More information about the Filepro-list
mailing list