home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / librdb2.zip / SEARCH.CMD < prev    next >
OS/2 REXX Batch file  |  1987-02-14  |  1KB  |  46 lines

  1. * SEARCH.CMD - subprogram to find a REFERAL, given a SUBJECT.
  2. * used by GUIDE.CMD.
  3. * by M. Timin, November 1982
  4.  
  5. STORE T TO MORE
  6. * once around this main loop for each SUBJECT:
  7. DO WHILE MORE
  8.    SELECT SECONDARY
  9.    STORE "            " TO SUB
  10.    ERASE
  11.    @ 2,2 SAY "Give me the name of a subject. "
  12.    @ 3,2 SAY "(or CR to return to main menu)" GET SUB   PICTURE '!!!!!!!!!!!!'
  13.    READ
  14.    IF SUB="            "
  15.       STORE F TO MORE
  16.    ELSE
  17.       STORE SUB TO SAME
  18.       FIND &SUB
  19.       * once thru here for each copy of the SUBJECT in the secondary file:
  20.       DO WHILE # <> 0  .and.  SUBJECT = SAME  .and. .not. EOF
  21.          SELE PRIMARY
  22.          * find and describe the REFERAL corresponding to the SUBJECT:
  23.          STORE S.KEY TO SKEY
  24.          FIND &SKEY
  25.          DISPLAY  NEXT 1   DESCRIP
  26.          SELE SECONDARY
  27.          SKIP
  28.       ENDDO
  29.       SELECT PRIMARY
  30.       STORE # TO RECNUM
  31.       * Hear we tell how to find each REFERAL requested by the user:
  32.       DO WHILE RECNUM <> 0
  33.          ? "Enter the record number which interests you, or 0 to quit:"
  34.          INPUT TO RECNUM
  35.          IF RECNUM <> 0
  36.             ? "   FILE       DISK        SEARCHKEY"
  37.             GOTO RECNUM
  38.             ? FILE+" ",STR(DISK,2)+"       "+SEARCHKEY
  39.          ENDIF
  40.       ENDDO
  41.    ENDIF
  42. ENDDO
  43. RETURN
  44.     GOTO RECNUM
  45.             ? FILE+" ",STR(DISK,2)+"       "+SEARCHKEY
  46.