home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG105.ARC
/
MAILMEN.LQR
/
PRINTCAT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
7KB
|
270 lines
* PRINTCAT.PRG PROGRAM FOR VIEWING AND PRINTING MAILING LIST ENTRIES COPYRIGHT
* NOVEMBER 1983 BY PHILIP K. PERLMAN
SET TALK OFF
STORE T TO BEVEL
DO WHILE BEVEL
ERASE
STORE ' ' TO ANS1
@ 10,5 say "Do you wish to print a list of friends or business (F or B) ?"
@ 10,75 GET ANS1
READ
CLEAR GETS
IF !(ANS1) = 'F' .OR. !(ANS1) = 'B'
STORE F TO BEVEL
ELSE
ENDIF
ENDDO
IF !(ANS1) = 'F'
STORE T TO VIEW
DO WHILE VIEW
STORE ' ' TO VIEW1
ERASE
@ 10,5 SAY "Press 'P' to Print the Results"
@ 12,5 SAY "Press 'V' to View the Results On Screen"
@ 12,75 GET VIEW1
READ
CLEAR GETS
IF !(VIEW1)= 'P'
SET PRINT ON
STORE 60 TO N
? CHR(15)
STORE F TO VIEW
ELSE
IF !(VIEW1) = 'V'
STORE 11 TO N
STORE F TO VIEW
ELSE
ENDIF
ENDIF
ENDDO
ERASE
STORE 0 TO INDEX2
USE &DBF1 INDEX &NDX1
erase
GO TOP
STORE T TO TRUE
DO WHILE TRUE
IF !(VIEW1) = 'P'
? 'NAME',' ','|', 'COMPANY', ' ';
,' ','|', 'OFFICE TEL. ','|', 'HOME TEL.'
? '====',' ','|', '=======', ' ';
,' ','|', '=========== ','|', '========='
ENDIF
DO WHILE .NOT. EOF .AND. INDEX2 < N
IF FRIEND <> ' '
? LAST, FIRST,'|', COMPANY,'|', TEL:WRK,'|', TEL:HM
STORE INDEX2 +1 TO INDEX2
ENDIF
SKIP
ENDDO
IF !(VIEW1)= 'P' .AND. INDEX2 >= N
EJECT
STORE 0 TO INDEX2
ENDIF
IF !(VIEW1)= 'V'
WAIT
IF INDEX2 >= N
STORE 0 TO INDEX2
ENDIF
ENDIF
IF EOF
STORE F TO TRUE
ENDIF
ENDDO
EJECT
? CHR(18)
SET PRINT OFF
RETURN
ENDIF
IF !(ANS1) = 'B'
STORE T TO RIGHT
DO WHILE RIGHT
STORE ' ' TO P
ERASE
@ 10,5 SAY "Press 'A' To View / Print All Categories"
@ 12,5 SAy "Press 'S' to View / Print Selected categories"
@ 12,70 get P
READ
CLEAR GETS
IF !(P) = 'A' .OR. !(P) = 'S'
STORE F TO RIGHT
ELSE
ENDIF
ENDDO
IF !(P) = 'A'
ERASE
STORE T TO VIEW
DO WHILE VIEW
STORE ' ' TO VIEW1
ERASE
@ 10,5 SAY "Press 'P' to Print the Results"
@ 12,5 SAY "Press 'V' to View the Results Onscreen"
@ 12,75 GET VIEW1
READ
CLEAR GETS
IF !(VIEW1)= 'P'
STORE 60 TO N
SET PRINT ON
? CHR(15)
STORE F TO VIEW
ELSE
IF !(VIEW1) = 'V'
STORE 11 TO N
STORE F TO VIEW
ELSE
ENDIF
ENDIF
ENDDO
STORE 0 TO INDEX2
erase
USE &DBF1 INDEX &NDX2
GO TOP
STORE T TO TRUE
DO WHILE TRUE
IF !(VIEW1) = 'P'
? 'COMPANY',' ','|', 'NAME', ' ';
,' ','|','OFFICE TEL. ','|', 'HOME TEL.'
? '=======',' ','|', '====', ' ';
,' ','|','=========== ','|', '========='
ENDIF
DO WHILE .NOT. EOF .AND. INDEX2 < N
IF BUS:XMAS <> ' '
? COMPANY,'|', FIRST, LAST,'|', TEL:WRK,'|', TEL:HM
STORE INDEX2 +1 TO INDEX2
ENDIF
SKIP
ENDDO
IF !(VIEW1) = 'P' .AND. INDEX2 >= N
EJECT
STORE 0 TO INDEX2
ENDIF
IF !(VIEW1) = 'V'
WAIT
IF INDEX2 >= N
STORE 0 TO INDEX2
ENDIF
ENDIF
IF EOF
STORE F TO TRUE
ENDIF
ENDDO
EJECT
? CHR(18)
SET PRINT OFF
RETURN
ENDIF
IF !(P) = 'S'
STORE T TO CONTINUE
DO WHILE CONTINUE
SET PRINT OFF
STORE T TO LEVEL
DO WHILE LEVEL
STORE ' ' TO ANS
STORE ' ' TO CAT
ERASE
?
?
?
?
ACCEPT "What Priority Level Are You Searching (1,2, OR 3) ?" TO ANS
?
?
ACCEPT "What Category Are You Looking For ?" TO CAT
IF ANS = '1' .OR. ANS = '2' .OR. ANS = '3'
STORE 'PROF'-ANS TO PROF
STORE DRV1-':'-'PROF'-ANS TO MNDX
STORE F TO LEVEL
ELSE
ENDIF
ENDDO
ERASE
STORE !(CAT) TO CAT
STORE T TO VIEW
DO WHILE VIEW
STORE ' ' TO VIEW1
ERASE
@ 10,5 SAY "Press 'P' to Print the Results"
@ 12,5 SAY "Press 'V' to View the Results On Screen"
@ 12,75 GET VIEW1
READ
CLEAR GETS
IF !(VIEW1)= 'P'
STORE 60 TO N
SET PRINT ON
? CHR(15)
STORE F TO VIEW
ELSE
IF !(VIEW1) = 'V'
STORE 11 TO N
STORE F TO VIEW
ELSE
ENDIF
ENDIF
ENDDO
ERASE
USE &DBF1 INDEX &MNDX
FIND &CAT
ERASE
STORE 0 TO INDEX
STORE T TO TRUE
DO WHILE TRUE
? "&CAT"
? "------------------------------"
IF !(VIEW1) = 'P'
? 'COMPANY',' ','|', 'NAME', ' ';
,' ','|','OFFICE TEL. ','|', 'HOME TEL.'
? '=======',' ','|', '====', ' ';
,' ','|','=========== ','|', '========='
ENDIF
DO WHILE .NOT. EOF .AND. &PROF = '&CAT' .AND. INDEX < N
? COMPANY,'|', FIRST, LAST,'|', TEL:WRK,'|', TEL:HM
STORE INDEX +1 TO INDEX
SKIP
ENDDO
IF !(VIEW1) = 'P' .AND. INDEX >= N
EJECT
STORE 0 TO INDEX
ENDIF
IF !(VIEW1) = 'V'
WAIT
IF INDEX >= N
STORE 0 TO INDEX
ENDIF
ENDIF
IF EOF
STORE F TO TRUE
ENDIF
IF &PROF <> '&CAT'
STORE F TO TRUE
ENDIF
ENDDO
ERASE
STORE ' ' TO CONT
@ 10,5 SAY 'Do you wish to continue ?'
@ 12,5 SAY "Press 'N' to Return to the Menu"
@ 14,5 SAY 'Press any other key to continue'
@ 14,40 GET CONT
READ
CLEAR GETS
IF !(CONT) = 'N'
EJECT
? CHR(18)
SET PRINT OFF
STORE F TO CONTINUE
RETURN
ELSE
ENDDO
ENDIF
ENDIFP) = 'A' .OR. !(P) = 'S'
STORE F TO RIGHT
ELSE
ENDIF
ENDDO
IF !(P) = 'A'
ERASE
STORE T TO VIEW
DO WHILE VIEW
STORE ' ' TO VIEW1
ERASE
@ 10,5 SAY "Press 'P' to Print the