lookup problem

Richard Kreiss rkreiss at verizon.net
Wed Aug 4 15:25:00 PDT 2010


-----Original Message-----
From: Kenneth Brody [mailto:kenb at fptech.com] 
Sent: Wednesday, August 04, 2010 2:15 PM
To: Richard Kreiss
Cc: filepro-list at lists.celestial.com
Subject: Re: lookup problem

On 8/3/2010 6:16 PM, Richard Kreiss wrote:
[...]
>> *** A filePro Error Has Occurred ***
>>
>> On File: C:\appl\ccp/filepro/transaction/index.A
>>
>> Input Processing
>>
>> Line Number: 450
>>
>>           rn=sales(@rn);GOTO lok_sjn
>> ^
>>
>>           @bk = "s"
>>           rn=sales(@rn);GOTO lok_sjn
[...]
> 445  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: aa="(brw=10 xkey=xs show=keep pop=show fill=desc,top)"
> 446  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: ab="[JOURNAL # START DATE  TYPE  PER    FEE       CC TYPE    LAST 4]"
> 447  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: ac="*1        *6            *7    *8  $*9          *14      *32"
> 448  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> do_lk_r◄ If:
>         Then: lookup sales = sales_journal  k=16   i=C -NXm b=(aa&ab&ac)
> 449  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:         @sk = "BRKY" or @bk = "X"
>         Then:         CLEARB;SHOW "";pw="";END
> 450  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:         @bk = "s"
>         Then:         rn=sales(@rn);GOTO lok_sjn
> 451  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If:
>         Then: CLEARB;END

First, as others have pointed out, you have no "if not sales" after the lookup.

Since you say this is failing in dclerk, I would add:

do_lk_r
     then: debug on
     then: lookup sales = sales_journal ...
       if: not sales
     then: ... do something ...

When you hit the lookup statement, check the value of field 16, including 
any leading, trailing, and embedded spaces.  What is the exact value of 
field 16, including all spaces?

Step through the lookup.  Did it display the browse window, and wait for you 
to press "S"?

What does the debugger show as the value of "not sales"?

-- 
Kenneth Brody

Still at Denver Airport - flight delays for planes coming East.

Added the following:
445  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:                                                                   ◄
       Then: msgbox "Field 16 is \b5"<16<"\a-\nVersion # \b2"<@vr<"\a-"        ◄

And

do_lk_r◄ If:                                                                   ◄
       Then: lookup sales = sales_journal  k=16   i=C -NXm b=(aa&ab&ac)        ◄
450  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         NOT sales                                                 ◄
       Then:         BEEP;ERRORBOX "No Sales Journal Record found for \r"<maste_code;CLEARB;END

And
456  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:                                                                   ◄
       Then: lookup sales = sales_journal  r=rn   -n                           ◄
457  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         NOT sales                                                 ◄
       Then:         ERRORBOX "Sales journal Record # \r"<rn<"\r Not Found";CLEARB;END
458  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: popup sales,"renew"
459  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: input popup("20","-1") y "is this the correct record?\n(Y)es or (N
460  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         y = "" or @sk = "BRKY"
       Then:         pw = "";CLEARP;ENDResult of 445:


───────────────────────────────────────
    Wo┌──────────────────────────┐ Sale
      │ Field 16 is  1003-10005  │   ◄
──────│ Version #  5.6.10R9      │─────
      └────────── Press  Enter   ┘ DO N
                ◄                ◄

Result of 450
──────────────────────────────────────────────
Sales Journal:   30190  Code : 1003-10005   Renewal: 01    Status: C      │
                                                                          │
  Sales Date: 11/19/2005◄      Start Date: 08/01/2011◄     │                  │
    Pay Type: CC◄               
 Period Type: S◄  
  Annual fee:  1,500.00◄      │ 
                                             └──────────────────────────────────────────┘│
                                                                          │
Credit Card: VM◄   Reference #:                    ◄                      │─
                   Exp Date:  7◄ 2011◄         ◄                          │
                                                                          │
     ┌──────────────────────┤ Comment ├───────────────────┐      Date     │─
     │                                                    │            ◄  │
──────────────────────────────────────────────────────────────────────────┘
──────────────────────────────────┤
                  ema┌─────────────────────────────┐                       ◄
─────────────────────│ is this the correct record?      │────────────────────────
  Screen 1           │ (Y)es or (N)o ->  ◄                                         │     Record:     6648
                           └─────────────────────────────┘

The above was run using rclerk and the not sales and msgbox were just added.


Dclerk:

─────────────────────────────────
Wo┌──────────────────────────┐ Sa
  │ Field 16 is  1003-10005  │
──│ Version #  5.6.10D9      │───
  └────────── Press  Enter   ┘ DO
            ◄                ◄
─────────────────────────────────

────┌───────────────────────────────────────────────────────────────┐──
 Add│ JOURNAL # START DATE  TYPE  PER    FEE       CC TYPE    LAST 4│
    ├───────────────────────────────────────────────────────────────┤
 Cit│   30190   08/01/2011    CC    S   $ 1,500.00   VM       8304  │
   ─│   30189   08/01/2010    CC    S   $ 1,500.00   VM       8304  │──
  Ho│       ┌───────────────────────────────────────────────┐       │rs
(714│      │ No Sales Journal Record found for  1003-10005 │       │
────│   └─────────────────────────────── Press  Enter   ┘       │──
Date│                                                               │
03/0└─End of File───────────────────────────────────────────────────┘
───────────────────────────────────────────────────────────────────────

As shown, the program functions properly when using rclerk but not dclerk.

It appears that the 2 sales journal records are found as the browse appears.  The  if: not sales at line 450 executes even though records were found.  It doesn't execute, line 450, when rclerk is used.

Richard 




More information about the Filepro-list mailing list