not foobar lookup problem

RKreiss1 rkreiss1 at comcast.net
Thu Nov 20 07:29:47 PST 2008


Top post to answer John:

Auto processing:

102  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: lv=master_code&"9"{""
103  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: lookup sales = sales_journal  k=lv   i=C -nl
104  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         NOT sales
       Then:         GOTO done_2
105  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         sales(4) ne master_code
       Then:         GOTO done_2
106  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then:         jo(7,.0)=sales(1);getprev sales
107  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
Is_last◄ If:         sales(4) = master_code
       Then:         jn(7,.0)=sales(1);GOTO do_last
108  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

The above code looks for the highest sales journal record associated with this person.  After getting the sales journal number, the program next does a lookup to a transaction file and reads in all of the transaction info to be displayed on screen 9.

Now in input processing there are 2 @key options which will access sales_journal, one creates a new record using lookup free

1410 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then: lookup sales = sales_journal  r=free  -n
1411 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         NOT sales
       Then:         MSGBOX "Error in Posting to Sales Journal";SAVE
1412 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then:         sales(1)=j_num;sales(2)=doc_code;sales(3)=patient_code
1413 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then:         sales(4)=master_code;sales(5)=@td;sales(6)=mb;sales(7)=md
1414 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then:         sales(8)="";sales(9)=mc;sales(10)=me;sales(11)="";sales(12
1415 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         'status        card #      approv #      Expire Date expir
       Then:         sales(13)="C";sales(14)="";sales(15)="";sales(16)=cm;sales
1416 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:
       Then:         write sales;sync sales

The other is a bit more complicated.  When @keys is pressed, the routine does a lookup to this file based on the home phone #.  If a matches are found, a browse lookup is executed to check if anyone with a matching phone # has just joined.  This is based on field 25="6" and field 40="O".
This is checked with a drop routine.  If that record matched, the program then does a lookup the sales journal record for that person and the dummy field df displays a summary of the sales information.  The routine ends and displays each possible match in the browse window.  When selected, the routine copies that record to a new record using copy xxxx to yyyy.  Those fields which need to be changed are updated and the program ends.

1672 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:
      Then: declare ccp_num(len(16),edit(16))
1673 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:
      Then: ccp_num=mark(16); m(10,ccp)=mark(16)&""
1674 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:
      Then: lookup salej = sales_journal  k=m    i=C -nx
1675 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:         NOT salej
      Then:         DF="Problem Finding SalesJournal Record";END
1676 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:         salej(7) = "CC" and salej(14) = "AM"
      Then:         df(35,*)="AMEX - Last 4 XXXX"<salej(32)
1677 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:         salej(7) = "CC" and salej(14) = "VM"
      Then:         df="VISA/Mastercard - Last 4 XXXX"<salej(32)
1678 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(7) = "CC" and salej(14) = "DI"
       Then:         df="DISCOVER - Last 4 XXXX"<salej(32)
1679 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(7) = "AC"
       Then:         df=""{"Auto"<sales(15)<"Route"<salej(35)
1680 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(7) = "CH"
       Then:         df="Check"
1681 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(8) = "A"
       Then:         df="Annual"<df
1682 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(8) = "S"
       Then:         df="Semi-Annual"<df
1683 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ◄ If:         salej(8) = "Q"
       Then:         df="Quarterly"<df
684 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If:         salej(8) = "M"
      Then:         df="Monthly"<df
685 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
      ◄ If: 'return to browse and display results
      Then: END

The problem arose at line 1674 when the alias was "sales".  The "not sales" executed as true even though there was a sales journal record associated with the master code used for the lookup.  After changing the edit from ccp to * and testing with the same results, the only thing I had not changed was the alias.  Once the alias was changed the program operated properly.

As I said, I have sales=sales_journal both in auto process and in this input processing table.  However, these references either refer to records associatred with this master_code or do a lookup free.

Maybe it is the sales alias in this input table that created the problem even though the program line(s) have not been executed. 

Would the sales_jouranl be opened using the sales alias even though the programming lines have not been executed?


Richard Kreiss
GCC Consulting
rkreiss at gccconsulting.net
  






> -----Original Message-----
> From: John Esak [mailto:john at valar.com]
> Sent: Thursday, November 20, 2008 3:00 AM
> To: rkreiss1 at comcast.net; 'filePro'
> Subject: RE: not foobar lookup problem
> 
>  Richard,
> Your analysis doesn't seem to me to be correct.  Can you put up a precise 4
> or 5 line code duplication of the problem.  I can't.  I don't see how a
> lookup done in auto processing can chave any bearing on lookups done in
> another table... Unless you store some of the values retrieved in some
> global variable and are referring to those variables.
> 
> Maybe something else is going on?  Incidentally, how are you changing the
> key for the lookup when you say it is done several times... By changing
> reords, or how?
> 
> Anyway, can't see a connection between something happening on the auto
> table
> in a lookup affecting some lookup on another table.
> 
> John
> 
> 
> > -----Original Message-----
> > From: filepro-list-bounces+john=valar.com at lists.celestial.com
> > [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
> m] On Behalf Of RKreiss1
> > Sent: Wednesday, November 19, 2008 6:20 PM
> > To: 'filePro'
> > Subject: not foobar lookup problem
> >
> > Just as a heads up if you run into this problem:
> >
> > Added some additional functionality to  file1 having it do a lookup to
> > foobar using the master-code from a record in file1 which had
> > the same phone
> > # as the record I am sitting on.
> >
> > Lookup foo=foobar  k=mc   i=c -xn
> > Not foo
> > END
> > More programming
> >
> > Each time the program hit the not line, the debugger showed
> > that the line
> > was true even though a record existed in foobar for that master-code.
> >
> > After checking this a number of times, I checked my auto.prc
> > table.  The
> > auto process table checks foobar using the alias foo for the
> > current record.
> >
> > When I changed foo to fop the lookup worked just fine.
> >
> > Morel of the story, if one uses auto.prc and a lookup which
> > should work
> > fails in input or output process, check auto for a lookup to
> > that file.
> >
> >
> > Richard Kreiss
> > GCC Consulting
> > rkreiss at gccconsulting.net
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Filepro-list mailing list
> > Filepro-list at lists.celestial.com
> > http://mailman.celestial.com/mailman/listinfo/filepro-list
> >





More information about the Filepro-list mailing list