Home » Archimedes archive » Micro User » MU 1992-06.adf » PD » Un-PScript

Un-PScript

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1992-06.adf » PD
Filename: Un-PScript
Read OK:
File size: 03A1 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > <BasicSave$Dir>.Un-PScript
   20
   30INPUT"PostScript input file",f$
   40INPUT"Text output file",g$
   50
   60Z%=OPENIN f$
   70Y%=OPENOUTg$
   80op=FALSE:force=FALSE:last%=32
   90WHILE NOT EOF#Z%
  100  B%=BGET#Z%
  110  IF op THEN
  120      IF force THEN
  130          IF B%=13 OR B%=10 THEN
  140            ELSE
  150              PROCsend(B%)
  160              force=FALSE
  170            ENDIF
  180        ELSE
  190          CASE B% OF
  200            WHEN ASC"\" : force=TRUE
  210            WHEN ASC")" : IF last%<>32 THEN
  220                              CASE last% OF
  230                                WHEN ASC"." : PROCsend(13)
  240                                WHEN ASC":" : PROCsend(13)
  250                                OTHERWISE PROCsend(32)
  260                                ENDCASE
  270                            ENDIF
  280                          op=FALSE
  290          OTHERWISE PROCsend(B%)
  300          ENDCASE
  310        ENDIF
  320      IF force ELSE last%=B%
  330    ELSE
  340      IF B%=ASC"(" op=TRUE
  350    ENDIF
  360  ENDWHILE
  370CLOSE#Y%
  380CLOSE#Z%
  390END
  400DEF PROCsend(B%)
  410BPUT#Y%,B%:VDUB%
  420IF B%=13 VDU10
  430ENDPROC

"� > <BasicSave$Dir>.Un-PScript

�"PostScript input file",f$
(�"Text output file",g$
2
<Z%=� f$
F
Y%=�g$
Pop=�:force=�:last%=32
Z
ȕ � �#Z%
d
  B%=�#Z%
n  � op �
x      � force �
�          � B%=13 � B%=10 �
�            �
�              �send(B%)
�              force=�
�            �
�
        �
�          Ȏ B% �
�             � �"\" : force=�
�&            � �")" : � last%<>32 �
�,                              Ȏ last% �
�6                                � �"." : �send(13)
�6                                � �":" : �send(13)
�/                                 �send(32)
%                                �
!                            �
"                          op=�
"           �send(B%)
,          �
6
        �
@      � force � last%=B%
J	    �
T      � B%=�"(" op=�
^	    �
h  �
r�#Y%
|�#Z%
��
�� �send(B%)
��#Y%,B%:�B%
�� B%=13 �10
��
�
00000000  0d 00 0a 22 f4 20 3e 20  3c 42 61 73 69 63 53 61  |...". > <BasicSa|
00000010  76 65 24 44 69 72 3e 2e  55 6e 2d 50 53 63 72 69  |ve$Dir>.Un-PScri|
00000020  70 74 0d 00 14 04 0d 00  1e 1f e8 22 50 6f 73 74  |pt........."Post|
00000030  53 63 72 69 70 74 20 69  6e 70 75 74 20 66 69 6c  |Script input fil|
00000040  65 22 2c 66 24 0d 00 28  1a e8 22 54 65 78 74 20  |e",f$..(.."Text |
00000050  6f 75 74 70 75 74 20 66  69 6c 65 22 2c 67 24 0d  |output file",g$.|
00000060  00 32 04 0d 00 3c 0b 5a  25 3d 8e 20 66 24 0d 00  |.2...<.Z%=. f$..|
00000070  46 0a 59 25 3d ae 67 24  0d 00 50 19 6f 70 3d a3  |F.Y%=.g$..P.op=.|
00000080  3a 66 6f 72 63 65 3d a3  3a 6c 61 73 74 25 3d 33  |:force=.:last%=3|
00000090  32 0d 00 5a 0d c8 95 20  ac 20 c5 23 5a 25 0d 00  |2..Z... . .#Z%..|
000000a0  64 0d 20 20 42 25 3d 9a  23 5a 25 0d 00 6e 0c 20  |d.  B%=.#Z%..n. |
000000b0  20 e7 20 6f 70 20 8c 0d  00 78 13 20 20 20 20 20  | . op ...x.     |
000000c0  20 e7 20 66 6f 72 63 65  20 8c 0d 00 82 1f 20 20  | . force .....  |
000000d0  20 20 20 20 20 20 20 20  e7 20 42 25 3d 31 33 20  |        . B%=13 |
000000e0  84 20 42 25 3d 31 30 20  8c 0d 00 8c 11 20 20 20  |. B%=10 .....   |
000000f0  20 20 20 20 20 20 20 20  20 cc 0d 00 96 1b 20 20  |         .....  |
00000100  20 20 20 20 20 20 20 20  20 20 20 20 f2 73 65 6e  |            .sen|
00000110  64 28 42 25 29 0d 00 a0  19 20 20 20 20 20 20 20  |d(B%)....       |
00000120  20 20 20 20 20 20 20 66  6f 72 63 65 3d a3 0d 00  |       force=...|
00000130  aa 11 20 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |..            ..|
00000140  00 b4 0d 20 20 20 20 20  20 20 20 cc 0d 00 be 15  |...        .....|
00000150  20 20 20 20 20 20 20 20  20 20 c8 8e 20 42 25 20  |          .. B% |
00000160  ca 0d 00 c8 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00000170  20 c9 20 97 22 5c 22 20  3a 20 66 6f 72 63 65 3d  | . ."\" : force=|
00000180  b9 0d 00 d2 26 20 20 20  20 20 20 20 20 20 20 20  |....&           |
00000190  20 c9 20 97 22 29 22 20  3a 20 e7 20 6c 61 73 74  | . .")" : . last|
000001a0  25 3c 3e 33 32 20 8c 0d  00 dc 2c 20 20 20 20 20  |%<>32 ....,     |
000001b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000001c0  20 20 20 20 20 20 20 20  20 c8 8e 20 6c 61 73 74  |         .. last|
000001d0  25 20 ca 0d 00 e6 36 20  20 20 20 20 20 20 20 20  |% ....6         |
000001e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000001f0  20 20 20 20 20 20 20 c9  20 97 22 2e 22 20 3a 20  |       . ."." : |
00000200  f2 73 65 6e 64 28 31 33  29 0d 00 f0 36 20 20 20  |.send(13)...6   |
00000210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000220  20 20 20 20 20 20 20 20  20 20 20 20 20 c9 20 97  |             . .|
00000230  22 3a 22 20 3a 20 f2 73  65 6e 64 28 31 33 29 0d  |":" : .send(13).|
00000240  00 fa 2f 20 20 20 20 20  20 20 20 20 20 20 20 20  |../             |
00000250  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000260  20 20 20 7f 20 f2 73 65  6e 64 28 33 32 29 0d 01  |   . .send(32)..|
00000270  04 25 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.%              |
00000280  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000290  20 20 cb 0d 01 0e 21 20  20 20 20 20 20 20 20 20  |  ....!         |
000002a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002b0  20 20 20 cd 0d 01 18 22  20 20 20 20 20 20 20 20  |   ...."        |
000002c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002d0  20 20 6f 70 3d a3 0d 01  22 19 20 20 20 20 20 20  |  op=...".      |
000002e0  20 20 20 20 7f 20 f2 73  65 6e 64 28 42 25 29 0d  |    . .send(B%).|
000002f0  01 2c 0f 20 20 20 20 20  20 20 20 20 20 cb 0d 01  |.,.          ...|
00000300  36 0d 20 20 20 20 20 20  20 20 cd 0d 01 40 1c 20  |6.        ...@. |
00000310  20 20 20 20 20 e7 20 66  6f 72 63 65 20 8b 20 6c  |     . force . l|
00000320  61 73 74 25 3d 42 25 0d  01 4a 09 20 20 20 20 cc  |ast%=B%..J.    .|
00000330  0d 01 54 18 20 20 20 20  20 20 e7 20 42 25 3d 97  |..T.      . B%=.|
00000340  22 28 22 20 6f 70 3d b9  0d 01 5e 09 20 20 20 20  |"(" op=...^.    |
00000350  cd 0d 01 68 07 20 20 ce  0d 01 72 08 d9 23 59 25  |...h.  ...r..#Y%|
00000360  0d 01 7c 08 d9 23 5a 25  0d 01 86 05 e0 0d 01 90  |..|..#Z%........|
00000370  0f dd 20 f2 73 65 6e 64  28 42 25 29 0d 01 9a 0f  |.. .send(B%)....|
00000380  d5 23 59 25 2c 42 25 3a  ef 42 25 0d 01 a4 0f e7  |.#Y%,B%:.B%.....|
00000390  20 42 25 3d 31 33 20 ef  31 30 0d 01 ae 05 e1 0d  | B%=13 .10......|
000003a0  ff                                                |.|
000003a1