home *** CD-ROM | disk | FTP | other *** search
- *** PRTMANL.PRG ***
- ** An actual working version of a demonstration program
- ** provided by SUB ROSA PUBLISHING INC.
- **
- ** Purpose: produce a printable version of the SR-Info/VP-Info Manual
- ** for people who don't have an IBM character-set
- **
- **
- ** PRTMANL demonstrates the use of sequential file functions to produce
- ** an altered copy of given file.
- **
- ** PRTMANL is compatable with all current versions of SR-Info and VP-Info.
- **
- ** Bernie Melman and Sid Bursten
- ** April 1,1990
- ***************************************************************************
- SET raw on ;no extra space between print fields
- * initialize variables
- DIM char 1 matrix[256]
- infile=blank(15)
- standard=' '
- WINDOW ; get rid on any window left open.
- ERASE ; clear screen
- * set up input screen - note that all variables used have been initialized
- * .. lines are picture clauses forcing upper case for infile and standard
- TEXT
- .. infile !!!!!!!!!!!!!!!
- .. standard !
- This program will automatically print the manual provided
- to you on disk without any printer control codes other than
- carriage returm line feed and eject.
-
- If your printer does not support the standard IBM Proprinter
- character set, but does handle the standard Epson MX/FX
- series graphics characters, it substitutes box and rule
- characters appropriately.
-
- If your printer supports neither of these character sets,
- all graphics characters will be converted to vertical
- and horizontal broken lines, with plus signs at the borders
- of boxes.
-
- It works properly on PC-Info and PC-Info manuals on disk,
- but may not work for other input files.
-
- ┌───────────────────────────────────────────────────────────────────┐
- │ Name of file to convert and print: @infile │
- │───────────────────────────────────────────────────────────────────│
- │ Printer supports (I)BM, (E)pson, or (N)o graphics (I/E/N)? %standard │
- └───────────────────────────────────────────────────────────────────┘
- ENDTEXT
- ON field
- FIELD infile
- IF file(infile) ;file found
- ERASE 0,0
- ELSE
- RING
- @ 0,0 say trim(!(infile))+' not found. Press any key'
- ok=inkey()
- ENDIF
- FIELD standard
- IF @(standard,'NIE')>0 ;entry okay
- ERASE 0,0
- ELSE
- RING
- @ 0,0 say 'Improper entry. Use I, E or N only. Press any key'
- ok=inkey()
- ENDIF
- ENDON
- READ
- CLS
- IF ropen(infile); don't even try if files won't open
- SET print on
- IF standard='I'
- DO WHILE read(newline) ;if no conversion, route straight to printer
- ? newline
- ENDDO
- ELSE
- IF standard='E' ;convert to epson graphics
- * ;sorry, codes unavailable
- ELSE ;no graphics suported
- matrix[179]='|'
- REPEAT 39 times varying pos
- matrix[179+pos]='+'
- ENDREPEAT ;all values outside range 179-218 blank
- matrix[186]='|'
- matrix[196]='-'
- matrix[206]='-'
- ENDIF
- DO WHILE read(newline) ;start of main loop
- * test based on fact that any line with graphics starts with graphic
- IF ltrim(newline)>'}'
- ? ;goto new line on printer
- REPEAT len(newline) times varying pos
- ch=substr(newline,pos,1)
- IF ch>'{'
- ch=matrix[asc(ch)]
- ENDIF
- ?? ch
- ENDREPEAT
- ELSE
- ? newline
- ENDIF
- ENDDO ; end of main loop
- EJECT
- SET print off
- ok=close(1) ;close the input file,
- ENDIF
- ELSE
- ? "Unable to open input file :"+infile
- ENDIF
- *
- *** end of PRTMANL.PRG ***
-
-