Home » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_Dominic_2.adf » PrinterDMs/!PrinterLJ/PrSquasher

PrinterDMs/!PrinterLJ/PrSquasher

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 » Personal collection » Acorn ADFS disks » Greaseweazled » adfs_Dominic_2.adf
Filename: PrinterDMs/!PrinterLJ/PrSquasher
Read OK:
File size: 055A bytes
Load address: FFFFFB42
Exec address: 722408E2
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM > PrSquasher
   20REM
   30REM PrData file squasher for !PrinterLJ
   40REM 08-Jun-90
   50REM
   60REM Squashes a !PrinterLJ configuration file by removing
   70REM comments and spaces.
   80REM
   90:
  100PRINT'"PrData Squasher"'"---------------"'
  110:
  120I%=0:O%=0
  130ONERROR PROCerror: END
  140:
  150INPUTLINE "Input file name: " in$
  160I% = OPENIN(in$): IF I%=0 ERROR 1, "File not found"
  170INPUTLINE "Output file name: " out$
  180O% = OPENOUT(out$)
  190:
  200WHILE NOT EOF#I%
  210 line$ = GET$#I%
  220 D% = INSTR(line$,":")
  230 C% = INSTR(line$,";")
  240 IF (D% <> 0) AND (C% = 0 OR C% > D%) THEN
  250  B% = D%+1: WHILE MID$(line$,B%,1)=" ": B%+=1: ENDWHILE
  260  IF MID$(line$,B%,1) = """" THEN
  270   WHILE RIGHT$(line$) <> """": line$=LEFT$(line$): ENDWHILE
  280  ELSE
  290   E% = INSTR(line$,";",B%): IF E% THEN line$ = LEFT$(line$,E%-1)
  300  ENDIF
  310  WHILE RIGHT$(line$) = " ": line$=LEFT$(line$): ENDWHILE
  320  tag$ = LEFT$(line$,D%-1): val$ = MID$(line$,B%)
  330  BPUT#O%,tag$+":"+FNend(tag$,val$)
  340 ENDIF
  350ENDWHILE
  360:
  370S% = PTR#I%: T% = PTR#O%
  380:
  390CLOSE#I%: I%=0
  400CLOSE#O%: O%=0
  410OSCLI("Settype "+out$+" Data")
  420:
  430PRINT '"File ";in$;" squashed to ";out$;"."
  440PRINT "&";~S%;" to &";~T%;" bytes => ";INT((S%-T%)/S%*100);"% reduction in size."
  450:
  460END
  470:
  480DEFFNend(tag$,val$)
  490LOCAL L%: L% = LEN(val$)
  500CASE tag$ OF
  510 WHEN "page_name","file":
  520  = val$+STRING$(80-L%,";")
  530 WHEN "server","nfoption":
  540  = val$+STRING$(8-L%,";")
  550 WHEN "nfserver","nfprinter","nfuser":
  560  = val$+STRING$(16-L%,";")
  570 OTHERWISE
  580  = val$
  590ENDCASE
  600:
  610DEFPROCerror
  620ON ERROR OFF
  630PRINT REPORT$," at line ";ERL
  640IF I% CLOSE#I%
  650IF O% CLOSE#O%
  660ENDPROC

� > PrSquasher
�
)� PrData file squasher for !PrinterLJ
(� 08-Jun-90
2�
<:� Squashes a !PrinterLJ configuration file by removing
F� comments and spaces.
P�
Z:
d*�'"PrData Squasher"'"---------------"'
n:
x
I%=0:O%=0
�� �error: �
�:
�� "Input file name: " in$
�-I% = �(in$): � I%=0 � 1, "File not found"
� � "Output file name: " out$
�O% = �(out$)
�:
�
ȕ � �#I%
� line$ = �#I%
� D% = �line$,":")
� C% = �line$,";")
�' � (D% <> 0) � (C% = 0 � C% > D%) �
�.  B% = D%+1: ȕ �line$,B%,1)=" ": B%+=1: �
  � �line$,B%,1) = """" �
+   ȕ �line$) <> """": line$=�line$): �
  �
"7   E% = �line$,";",B%): � E% � line$ = �line$,E%-1)
,  �
6(  ȕ �line$) = " ": line$=�line$): �
@,  tag$ = �line$,D%-1): val$ = �line$,B%)
J#  �#O%,tag$+":"+�end(tag$,val$)
T �
^�
h:
rS% = �#I%: T% = �#O%
|:
��#I%: I%=0
��#O%: O%=0
��("Settype "+out$+" Data")
�:
�+� '"File ";in$;" squashed to ";out$;"."
�O� "&";~S%;" to &";~T%;" bytes => ";�((S%-T%)/S%*100);"% reduction in size."
�:
��
�:
�ݤend(tag$,val$)
�� L%: L% = �(val$)
�
Ȏ tag$ �
� � "page_name","file":
  = val$+�80-L%,";")
 � "server","nfoption":
  = val$+�8-L%,";")
&' � "nfserver","nfprinter","nfuser":
0  = val$+�16-L%,";")
: 
D  = val$
N�
X:
b��error
l	� � �
v� �$," at line ";�
�
� I% �#I%
�
� O% �#O%
��
�
00000000  0d 00 0a 12 f4 20 3e 20  50 72 53 71 75 61 73 68  |..... > PrSquash|
00000010  65 72 0d 00 14 05 f4 0d  00 1e 29 f4 20 50 72 44  |er........). PrD|
00000020  61 74 61 20 66 69 6c 65  20 73 71 75 61 73 68 65  |ata file squashe|
00000030  72 20 66 6f 72 20 21 50  72 69 6e 74 65 72 4c 4a  |r for !PrinterLJ|
00000040  0d 00 28 0f f4 20 30 38  2d 4a 75 6e 2d 39 30 0d  |..(.. 08-Jun-90.|
00000050  00 32 05 f4 0d 00 3c 3a  f4 20 53 71 75 61 73 68  |.2....<:. Squash|
00000060  65 73 20 61 20 21 50 72  69 6e 74 65 72 4c 4a 20  |es a !PrinterLJ |
00000070  63 6f 6e 66 69 67 75 72  61 74 69 6f 6e 20 66 69  |configuration fi|
00000080  6c 65 20 62 79 20 72 65  6d 6f 76 69 6e 67 0d 00  |le by removing..|
00000090  46 1a f4 20 63 6f 6d 6d  65 6e 74 73 20 61 6e 64  |F.. comments and|
000000a0  20 73 70 61 63 65 73 2e  0d 00 50 05 f4 0d 00 5a  | spaces...P....Z|
000000b0  05 3a 0d 00 64 2a f1 27  22 50 72 44 61 74 61 20  |.:..d*.'"PrData |
000000c0  53 71 75 61 73 68 65 72  22 27 22 2d 2d 2d 2d 2d  |Squasher"'"-----|
000000d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 22 27 0d 00 6e 05  |----------"'..n.|
000000e0  3a 0d 00 78 0d 49 25 3d  30 3a 4f 25 3d 30 0d 00  |:..x.I%=0:O%=0..|
000000f0  82 10 ee 85 20 f2 65 72  72 6f 72 3a 20 e0 0d 00  |.... .error: ...|
00000100  8c 05 3a 0d 00 96 1e e8  86 20 22 49 6e 70 75 74  |..:...... "Input|
00000110  20 66 69 6c 65 20 6e 61  6d 65 3a 20 22 20 69 6e  | file name: " in|
00000120  24 0d 00 a0 2d 49 25 20  3d 20 8e 28 69 6e 24 29  |$...-I% = .(in$)|
00000130  3a 20 e7 20 49 25 3d 30  20 85 20 31 2c 20 22 46  |: . I%=0 . 1, "F|
00000140  69 6c 65 20 6e 6f 74 20  66 6f 75 6e 64 22 0d 00  |ile not found"..|
00000150  aa 20 e8 86 20 22 4f 75  74 70 75 74 20 66 69 6c  |. .. "Output fil|
00000160  65 20 6e 61 6d 65 3a 20  22 20 6f 75 74 24 0d 00  |e name: " out$..|
00000170  b4 10 4f 25 20 3d 20 ae  28 6f 75 74 24 29 0d 00  |..O% = .(out$)..|
00000180  be 05 3a 0d 00 c8 0d c8  95 20 ac 20 c5 23 49 25  |..:...... . .#I%|
00000190  0d 00 d2 11 20 6c 69 6e  65 24 20 3d 20 be 23 49  |.... line$ = .#I|
000001a0  25 0d 00 dc 15 20 44 25  20 3d 20 a7 6c 69 6e 65  |%.... D% = .line|
000001b0  24 2c 22 3a 22 29 0d 00  e6 15 20 43 25 20 3d 20  |$,":").... C% = |
000001c0  a7 6c 69 6e 65 24 2c 22  3b 22 29 0d 00 f0 27 20  |.line$,";")...' |
000001d0  e7 20 28 44 25 20 3c 3e  20 30 29 20 80 20 28 43  |. (D% <> 0) . (C|
000001e0  25 20 3d 20 30 20 84 20  43 25 20 3e 20 44 25 29  |% = 0 . C% > D%)|
000001f0  20 8c 0d 00 fa 2e 20 20  42 25 20 3d 20 44 25 2b  | .....  B% = D%+|
00000200  31 3a 20 c8 95 20 c1 6c  69 6e 65 24 2c 42 25 2c  |1: .. .line$,B%,|
00000210  31 29 3d 22 20 22 3a 20  42 25 2b 3d 31 3a 20 ce  |1)=" ": B%+=1: .|
00000220  0d 01 04 1d 20 20 e7 20  c1 6c 69 6e 65 24 2c 42  |....  . .line$,B|
00000230  25 2c 31 29 20 3d 20 22  22 22 22 20 8c 0d 01 0e  |%,1) = """" ....|
00000240  2b 20 20 20 c8 95 20 c2  6c 69 6e 65 24 29 20 3c  |+   .. .line$) <|
00000250  3e 20 22 22 22 22 3a 20  6c 69 6e 65 24 3d c0 6c  |> """": line$=.l|
00000260  69 6e 65 24 29 3a 20 ce  0d 01 18 07 20 20 cc 0d  |ine$): .....  ..|
00000270  01 22 37 20 20 20 45 25  20 3d 20 a7 6c 69 6e 65  |."7   E% = .line|
00000280  24 2c 22 3b 22 2c 42 25  29 3a 20 e7 20 45 25 20  |$,";",B%): . E% |
00000290  8c 20 6c 69 6e 65 24 20  3d 20 c0 6c 69 6e 65 24  |. line$ = .line$|
000002a0  2c 45 25 2d 31 29 0d 01  2c 07 20 20 cd 0d 01 36  |,E%-1)..,.  ...6|
000002b0  28 20 20 c8 95 20 c2 6c  69 6e 65 24 29 20 3d 20  |(  .. .line$) = |
000002c0  22 20 22 3a 20 6c 69 6e  65 24 3d c0 6c 69 6e 65  |" ": line$=.line|
000002d0  24 29 3a 20 ce 0d 01 40  2c 20 20 74 61 67 24 20  |$): ...@,  tag$ |
000002e0  3d 20 c0 6c 69 6e 65 24  2c 44 25 2d 31 29 3a 20  |= .line$,D%-1): |
000002f0  76 61 6c 24 20 3d 20 c1  6c 69 6e 65 24 2c 42 25  |val$ = .line$,B%|
00000300  29 0d 01 4a 23 20 20 d5  23 4f 25 2c 74 61 67 24  |)..J#  .#O%,tag$|
00000310  2b 22 3a 22 2b a4 65 6e  64 28 74 61 67 24 2c 76  |+":"+.end(tag$,v|
00000320  61 6c 24 29 0d 01 54 06  20 cd 0d 01 5e 05 ce 0d  |al$)..T. ...^...|
00000330  01 68 05 3a 0d 01 72 18  53 25 20 3d 20 8f 23 49  |.h.:..r.S% = .#I|
00000340  25 3a 20 54 25 20 3d 20  8f 23 4f 25 0d 01 7c 05  |%: T% = .#O%..|.|
00000350  3a 0d 01 86 0e d9 23 49  25 3a 20 49 25 3d 30 0d  |:.....#I%: I%=0.|
00000360  01 90 0e d9 23 4f 25 3a  20 4f 25 3d 30 0d 01 9a  |....#O%: O%=0...|
00000370  1e ff 28 22 53 65 74 74  79 70 65 20 22 2b 6f 75  |..("Settype "+ou|
00000380  74 24 2b 22 20 44 61 74  61 22 29 0d 01 a4 05 3a  |t$+" Data")....:|
00000390  0d 01 ae 2b f1 20 27 22  46 69 6c 65 20 22 3b 69  |...+. '"File ";i|
000003a0  6e 24 3b 22 20 73 71 75  61 73 68 65 64 20 74 6f  |n$;" squashed to|
000003b0  20 22 3b 6f 75 74 24 3b  22 2e 22 0d 01 b8 4f f1  | ";out$;"."...O.|
000003c0  20 22 26 22 3b 7e 53 25  3b 22 20 74 6f 20 26 22  | "&";~S%;" to &"|
000003d0  3b 7e 54 25 3b 22 20 62  79 74 65 73 20 3d 3e 20  |;~T%;" bytes => |
000003e0  22 3b a8 28 28 53 25 2d  54 25 29 2f 53 25 2a 31  |";.((S%-T%)/S%*1|
000003f0  30 30 29 3b 22 25 20 72  65 64 75 63 74 69 6f 6e  |00);"% reduction|
00000400  20 69 6e 20 73 69 7a 65  2e 22 0d 01 c2 05 3a 0d  | in size."....:.|
00000410  01 cc 05 e0 0d 01 d6 05  3a 0d 01 e0 14 dd a4 65  |........:......e|
00000420  6e 64 28 74 61 67 24 2c  76 61 6c 24 29 0d 01 ea  |nd(tag$,val$)...|
00000430  16 ea 20 4c 25 3a 20 4c  25 20 3d 20 a9 28 76 61  |.. L%: L% = .(va|
00000440  6c 24 29 0d 01 f4 0d c8  8e 20 74 61 67 24 20 ca  |l$)...... tag$ .|
00000450  0d 01 fe 1a 20 c9 20 22  70 61 67 65 5f 6e 61 6d  |.... . "page_nam|
00000460  65 22 2c 22 66 69 6c 65  22 3a 0d 02 08 18 20 20  |e","file":....  |
00000470  3d 20 76 61 6c 24 2b c4  38 30 2d 4c 25 2c 22 3b  |= val$+.80-L%,";|
00000480  22 29 0d 02 12 1b 20 c9  20 22 73 65 72 76 65 72  |").... . "server|
00000490  22 2c 22 6e 66 6f 70 74  69 6f 6e 22 3a 0d 02 1c  |","nfoption":...|
000004a0  17 20 20 3d 20 76 61 6c  24 2b c4 38 2d 4c 25 2c  |.  = val$+.8-L%,|
000004b0  22 3b 22 29 0d 02 26 27  20 c9 20 22 6e 66 73 65  |";")..&' . "nfse|
000004c0  72 76 65 72 22 2c 22 6e  66 70 72 69 6e 74 65 72  |rver","nfprinter|
000004d0  22 2c 22 6e 66 75 73 65  72 22 3a 0d 02 30 18 20  |","nfuser":..0. |
000004e0  20 3d 20 76 61 6c 24 2b  c4 31 36 2d 4c 25 2c 22  | = val$+.16-L%,"|
000004f0  3b 22 29 0d 02 3a 06 20  7f 0d 02 44 0c 20 20 3d  |;")..:. ...D.  =|
00000500  20 76 61 6c 24 0d 02 4e  05 cb 0d 02 58 05 3a 0d  | val$..N....X.:.|
00000510  02 62 0b dd f2 65 72 72  6f 72 0d 02 6c 09 ee 20  |.b...error..l.. |
00000520  85 20 87 0d 02 76 16 f1  20 f6 24 2c 22 20 61 74  |. ...v.. .$," at|
00000530  20 6c 69 6e 65 20 22 3b  9e 0d 02 80 0d e7 20 49  | line ";...... I|
00000540  25 20 d9 23 49 25 0d 02  8a 0d e7 20 4f 25 20 d9  |% .#I%..... O% .|
00000550  23 4f 25 0d 02 94 05 e1  0d ff                    |#O%.......|
0000055a
PrinterDMs/!PrinterLJ/PrSquasher.m0
PrinterDMs/!PrinterLJ/PrSquasher.m1
PrinterDMs/!PrinterLJ/PrSquasher.m2
PrinterDMs/!PrinterLJ/PrSquasher.m4
PrinterDMs/!PrinterLJ/PrSquasher.m5