home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / bit / listserv / dbasel / 1394 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.5 KB  |  44 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!MCIMAIL.COM!0003081833
  3. Message-ID: <45921221171554/0003081833NA2EM@mcimail.com>
  4. Newsgroups: bit.listserv.dbase-l
  5. Date:         Mon, 21 Dec 1992 17:15:00 GMT
  6. Sender:       "Discussion on the use of the dBase language and related
  7.               dialects" <DBASE-L@NMSUVM1.BITNET>
  8. From:         "Anthony K. Lima" <0003081833@MCIMAIL.COM>
  9. Subject:      RE: Using popup menus for record selection
  10. Lines: 32
  11.  
  12. I've added a couple of comments.  It looks to me like you're
  13. not changing work areas before you do the LOCATE IN FindRec.
  14. -- Tony Lima
  15.  
  16. PROCEDURE PopMenu
  17.    SELECT 2            &&  AVACMAIN.DBF
  18.    * TL: Since the field name never changes, why not just
  19.    * use it instead of all the complexity with the FIELD()
  20.    * function and macro substitution?
  21.    Mfield = FIELD(3)   &&  last name field in AVACMAIN.DBF
  22.    DEFINE POPUP GetRec FROM 7,58 TO 14,70 PROMPT FIELD &Mfield ;
  23.           MESSAGE "Highlight and Press <ENTER> to make selection."
  24.    ON SELECTION POPUP GetRec DO FindRec
  25.    ACTIVATE POPUP GetRec
  26. RETURN  && (EOP PopMenu)
  27.  
  28. PROCEDURE FindRec
  29.    GOTO BAR()
  30.    Mlast=&Mfield
  31.    Mssn=Ssn
  32.    * TL:  Here's the problem:  You're not switching to a new
  33.    * dbf before you do the LOCATE.  You're LOCATEing in
  34.    * AVACMAIN.DBF.
  35.    LOCATE FOR Ssn=Mssn
  36.    IF FOUND()
  37.       Mname=TRIM(Last)+" "+TRIM(first)
  38.       @ 9,32 SAY Mname      &&  places first and last name on input screen
  39.    ENDIF
  40.    SELECT 1
  41.    SAVE SCREEN TO SavScr
  42.    DEACTIVATE POPUP
  43. RETURN  && (EOP FindRec)
  44.