home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / dbaseii / dblibray.lbr / LREPORTS.CZD / LREPORTS.CMD
OS/2 REXX Batch file  |  1988-05-04  |  2KB  |  81 lines

  1. **************************** LREPORTS.CMD
  2. ********** Asks user if they want keyword
  3. ********** listing or to search references
  4. ********** By subjects.  Provides the keyword
  5. ********** listing, branches to LIBFIND for
  6. ********** search by subject.
  7.  
  8. ERASE
  9. STORE " " TO RCHOICE
  10. @ 5,10 SAY " Which Report do you want "
  11. @ 7, 5 SAY "1. Keyword Listing"
  12. @ 8, 5 SAY "2. References by Subject"
  13. @ 10,8 SAY "Enter choice (1-2) " GET RCHOICE 
  14. READ
  15.  
  16. *********** Do appropriate report based upon user's request.
  17. DO CASE
  18.  
  19.    CASE RCHOICE = "1"
  20.       ******* Ask about hardcopy
  21.       ERASE
  22.       STORE " " TO LP
  23.       @ 5,10 SAY " Send Keywords to printer (Y/N) " GET LP
  24.       READ
  25.  
  26.       IF !(LP)="Y"
  27.          *SET PRINT ON
  28.       ENDIF (lp=y)
  29.  
  30.       *********** print keywords in two alphabetized columns.
  31.       ERASE
  32.       USE KEYWORDS
  33.       GO BOTT
  34.       STORE (#+1)/2 TO MIDDLE
  35.       STORE 1 TO COUNTER
  36.       USE KEYWORDS INDEX KEYWORDS
  37.       STORE "Y" TO OK
  38.       DO WHILE COUNTER <= MIDDLE .AND. !(OK)="Y" 
  39.          ? KEYWORD
  40.          SKIP MIDDLE
  41.          IF .NOT. EOF
  42.             ?? KEYWORD
  43.             SKIP -1*MIDDLE-1
  44.          ENDIF (not eof)
  45.          STORE COUNTER + 1 TO COUNTER
  46.   
  47.          ************** If keyword list going to the screen,
  48.          ************** Pause every 20 lines.
  49.          IF COUNTER/20 = INT(COUNTER/20) .AND. !(LP) <> "Y"
  50.             ?
  51.             ?
  52.             ? " Continue? (Y/N) "
  53.             WAIT TO OK
  54.          ENDIF (counter/20 and not lp)
  55.  
  56.          ************* If keyword list going to the 
  57.          ************* printer, eject page every 60 lines.
  58.          IF COUNTER/60 = INT(COUNTER/60) .AND. !(LP) = "Y"
  59.             EJECT
  60.          ENDIF (counter/60 and lp)      
  61.  
  62.  
  63.     ENDDO (counter and ok)
  64.     
  65.     ************* If keyword list going to the screen, pause
  66.     ************* before returning to the main menu.
  67.     IF !(LP) <> "Y"
  68.        ?
  69.        ?
  70.        ? " Press any key to return to main menu..."
  71.        WAIT
  72.     ENDIF (lp <> y)
  73.  
  74.  
  75.  
  76.     CASE RCHOICE = "2"
  77.          DO LIBFIND
  78.  
  79. ENDCASE
  80. RETURN
  81.