Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » PenDnHTML » !Install/Files/Linx

!Install/Files/Linx

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 » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » PenDnHTML
Filename: !Install/Files/Linx
Read OK:
File size: 0B13 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >> Linx
   20REM >> Extracts hypertext link data from PenDown DTP document
   30REM >> Output is to Wimp$Scrap
   40:
   50ON ERROR END
   60DIM path% 256, buff% 24, hbuff% 256, obuff% 64
   70PROCgetpath
   80SYS "OS_File",23,path% TO ,,,,,,filetype%
   90IF filetype% <> &BBA END
  100in% = OPENIN($path%)
  110out% = OPENOUT("<Wimp$Scrap>")
  120SYS "Hourglass_On"
  130ON ERROR REPORT:PROCclose:END
  140IF (in% > 0) AND (out% > 0) PROCESS
  150PROCclose
  160IF (in% > 0) SYS "OS_File",6,path% : REM delete
  170IF (out% > 0) OSCLI("SetType <Wimp$Scrap> &DFE")
  180END
  190:
  200DEFPROCESS
  210PROCgetblock(buff%,4,4):version% = !buff%
  220IF version% < 110 PROCclose:END
  230PROCout("Button text,Type,Link to,Target/identifier/command", CHR$(10), FALSE)
  240BPUT#out%,10
  250PROCgetblock(buff%,48,4):toff% = !buff%
  260PROCgetblock(buff%,toff%,4):tn% = !buff%
  270toff% += 4
  280FOR t% = 1 TO tn%
  290PROCgetblock(buff%,toff%,24)
  300toff% += 24
  310tsize% = buff%!8
  320PROCextractlinks(toff%,toff%+tsize%,toff%+(buff%!12),toff%+(buff%!16))
  330toff% += tsize%
  340NEXT
  350ENDPROC
  360:
  370DEFPROCgetpath
  380REM Get file path from command line
  390LOCAL c%, p%, i%
  400SYS "OS_GetEnv" TO c%
  410p% = path%
  420REPEAT
  430i% = ?c%
  440IF (i% = 32) THEN p% = path%
  450IF (i% > 32) THEN ?p% = i%: p% += 1
  460c% += 1
  470UNTIL (i% < 32)
  480?p% = 13
  490ENDPROC
  500:
  510DEFPROCextractlinks(off%,end%,cs%,ce%)
  520PTR#in% = off%
  530WHILE PTR#in% < end%
  540  IF PTR#in% = cs% THEN
  550    PTR#in% = ce%
  560  ELSE
  570    off% = PTR#in%
  580    c% = BGET#in%
  590    IF (c% >= 14) AND (c% < 32) THEN
  600      length% = BGET#in%
  610      IF (c% = 18) AND (BGET#in% = 5) THEN
  620        PROCgetblock(hbuff%,off%+3,length%-5)
  630        PROCoutputlinks(length%-5)
  640      ENDIF
  650      PTR#in% = off% + length%
  660    ENDIF
  670  ENDIF
  680ENDWHILE
  690ENDPROC
  700:
  710DEFPROCoutputlinks(len%)
  720type% = ?(hbuff% + len% - 1)
  730vlen% = ?(hbuff% + len% - 2)
  740PROCoutn(hbuff%, vlen%, ",", TRUE)
  750CASE type% OF
  760  WHEN 255
  770    PROCout("Reference", ",", TRUE)
  780    PROCout("", ",", FALSE)
  790  WHEN 10
  800    PROCout("Command", ",", TRUE)
  810    PROCout("", ",", FALSE)
  820  OTHERWISE
  830    IF ((type% AND 1) = 1) pos$ = "centre" ELSE pos$ = "top left"
  840    CASE (type% >> 1) OF
  850      WHEN 0
  860        type$ = "Page"
  870      WHEN 1
  880        type$ = "Frame"
  890      WHEN 2
  900        type$ = "Text"
  910      WHEN 3
  920        type$ = "Reference point"
  930      WHEN 4
  940        type$ = "Document"
  950    ENDCASE
  960    PROCout("Link", ",", TRUE)
  970    PROCout(type$+" (at "+pos$+")", ",", TRUE)
  980ENDCASE
  990PROCoutn(hbuff% + vlen%, len% - vlen% - 2, CHR$(10), TRUE)
 1000ENDPROC
 1010:
 1020DEFPROCgetblock(p%, offset%, length%)
 1030SYS "OS_GBPB",3,in%,p%,length%,offset%
 1040ENDPROC
 1050:
 1060DEFPROCout(o$, c$, q%)
 1070REM Output string and terminator to file
 1080$obuff% = o$
 1090PROCoutn(obuff%, LEN(o$), c$, q%)
 1100ENDPROC
 1110:
 1120DEFPROCoutn(o%, n%, c$, q%)
 1130REM Output counted string and terminator to file
 1140REM If q% = TRUE, enclose in quotes
 1150LOCAL i%
 1160IF q% BPUT#out%,34
 1170IF (n% > 0) THEN
 1180  FOR i% = 0 TO n% - 1
 1190  BPUT#out%,?(o% + i%)
 1200  NEXT
 1210ENDIF
 1220IF q% BPUT#out%,34
 1230BPUT#out%,ASC(c$)
 1240ENDPROC
 1250:
 1260DEFPROCclose
 1270IF in% > 0 CLOSE#in%
 1280IF out% > 0 CLOSE#out%
 1290SYS "Hourglass_Off"
 1300ENDPROC


� >> Linx
?� >> Extracts hypertext link data from PenDown DTP document
 � >> Output is to Wimp$Scrap
(:
2	� � �
<0� path% 256, buff% 24, hbuff% 256, obuff% 64
F�getpath
P+ș "OS_File",23,path% � ,,,,,,filetype%
Z� filetype% <> &BBA �
din% = �($path%)
nout% = �("<Wimp$Scrap>")
xș "Hourglass_On"
�� � �:�close:�
�!� (in% > 0) � (out% > 0) �ESS
�
�close
�/� (in% > 0) ș "OS_File",6,path% : � delete
�/� (out% > 0) �("SetType <Wimp$Scrap> &DFE")
��
�:
�	��ESS
�*�getblock(buff%,4,4):version% = !buff%
�� version% < 110 �close:�
�H�out("Button text,Type,Link to,Target/identifier/command", �(10), �)
�
�#out%,10
�(�getblock(buff%,48,4):toff% = !buff%
)�getblock(buff%,toff%,4):tn% = !buff%
toff% += 4
� t% = 1 � tn%
"�getblock(buff%,toff%,24)
,toff% += 24
6tsize% = buff%!8
@G�extractlinks(toff%,toff%+tsize%,toff%+(buff%!12),toff%+(buff%!16))
Jtoff% += tsize%
T�
^�
h:
r
��getpath
|%� Get file path from command line
�� c%, p%, i%
�ș "OS_GetEnv" � c%
�p% = path%
��
�i% = ?c%
�� (i% = 32) � p% = path%
�#� (i% > 32) � ?p% = i%: p% += 1
�c% += 1
�� (i% < 32)
�?p% = 13
��
�:
�%��extractlinks(off%,end%,cs%,ce%)
�#in% = off%
ȕ �#in% < end%
  � �#in% = cs% �
&    �#in% = ce%
0  �
:    off% = �#in%
D    c% = �#in%
N"    � (c% >= 14) � (c% < 32) �
X      length% = �#in%
b%      � (c% = 18) � (�#in% = 5) �
l.        �getblock(hbuff%,off%+3,length%-5)
v#        �outputlinks(length%-5)
�      �
�       �#in% = off% + length%
�	    �
�  �
��
��
�:
���outputlinks(len%)
� type% = ?(hbuff% + len% - 1)
� vlen% = ?(hbuff% + len% - 2)
� �outn(hbuff%, vlen%, ",", �)
�Ȏ type% �
�  � 255
!    �out("Reference", ",", �)
    �out("", ",", �)

  � 10
     �out("Command", ",", �)
*    �out("", ",", �)
4  
>?    � ((type% � 1) = 1) pos$ = "centre" � pos$ = "top left"
H    Ȏ (type% >> 1) �
R
      � 0
\        type$ = "Page"
f
      � 1
p        type$ = "Frame"
z
      � 2
�        type$ = "Text"
�
      � 3
�%        type$ = "Reference point"
�
      � 4
�        type$ = "Document"
�	    �
�    �out("Link", ",", �)
�,    �out(type$+" (at "+pos$+")", ",", �)
��
�5�outn(hbuff% + vlen%, len% - vlen% - 2, �(10), �)
��
�:
�$��getblock(p%, offset%, length%)
)ș "OS_GBPB",3,in%,p%,length%,offset%
�
:
$��out(o$, c$, q%)
.*� Output string and terminator to file
8$obuff% = o$
B �outn(obuff%, �(o$), c$, q%)
L�
V:
`��outn(o%, n%, c$, q%)
j2� Output counted string and terminator to file
t%� If q% = TRUE, enclose in quotes
~� i%
�� q% �#out%,34
�� (n% > 0) �
�  � i% = 0 � n% - 1
�  �#out%,?(o% + i%)
�  �
��
�� q% �#out%,34
��#out%,�(c$)
��
�:
���close
�� in% > 0 �#in%
� out% > 0 �#out%

ș "Hourglass_Off"
�
�
00000000  0d 00 0a 0d f4 20 3e 3e  20 4c 69 6e 78 0d 00 14  |..... >> Linx...|
00000010  3f f4 20 3e 3e 20 45 78  74 72 61 63 74 73 20 68  |?. >> Extracts h|
00000020  79 70 65 72 74 65 78 74  20 6c 69 6e 6b 20 64 61  |ypertext link da|
00000030  74 61 20 66 72 6f 6d 20  50 65 6e 44 6f 77 6e 20  |ta from PenDown |
00000040  44 54 50 20 64 6f 63 75  6d 65 6e 74 0d 00 1e 20  |DTP document... |
00000050  f4 20 3e 3e 20 4f 75 74  70 75 74 20 69 73 20 74  |. >> Output is t|
00000060  6f 20 57 69 6d 70 24 53  63 72 61 70 0d 00 28 05  |o Wimp$Scrap..(.|
00000070  3a 0d 00 32 09 ee 20 85  20 e0 0d 00 3c 30 de 20  |:..2.. . ...<0. |
00000080  70 61 74 68 25 20 32 35  36 2c 20 62 75 66 66 25  |path% 256, buff%|
00000090  20 32 34 2c 20 68 62 75  66 66 25 20 32 35 36 2c  | 24, hbuff% 256,|
000000a0  20 6f 62 75 66 66 25 20  36 34 0d 00 46 0c f2 67  | obuff% 64..F..g|
000000b0  65 74 70 61 74 68 0d 00  50 2b c8 99 20 22 4f 53  |etpath..P+.. "OS|
000000c0  5f 46 69 6c 65 22 2c 32  33 2c 70 61 74 68 25 20  |_File",23,path% |
000000d0  b8 20 2c 2c 2c 2c 2c 2c  66 69 6c 65 74 79 70 65  |. ,,,,,,filetype|
000000e0  25 0d 00 5a 19 e7 20 66  69 6c 65 74 79 70 65 25  |%..Z.. filetype%|
000000f0  20 3c 3e 20 26 42 42 41  20 e0 0d 00 64 13 69 6e  | <> &BBA ...d.in|
00000100  25 20 3d 20 8e 28 24 70  61 74 68 25 29 0d 00 6e  |% = .($path%)..n|
00000110  1c 6f 75 74 25 20 3d 20  ae 28 22 3c 57 69 6d 70  |.out% = .("<Wimp|
00000120  24 53 63 72 61 70 3e 22  29 0d 00 78 15 c8 99 20  |$Scrap>")..x... |
00000130  22 48 6f 75 72 67 6c 61  73 73 5f 4f 6e 22 0d 00  |"Hourglass_On"..|
00000140  82 12 ee 20 85 20 f6 3a  f2 63 6c 6f 73 65 3a e0  |... . .:.close:.|
00000150  0d 00 8c 21 e7 20 28 69  6e 25 20 3e 20 30 29 20  |...!. (in% > 0) |
00000160  80 20 28 6f 75 74 25 20  3e 20 30 29 20 f2 45 53  |. (out% > 0) .ES|
00000170  53 0d 00 96 0a f2 63 6c  6f 73 65 0d 00 a0 2f e7  |S.....close.../.|
00000180  20 28 69 6e 25 20 3e 20  30 29 20 c8 99 20 22 4f  | (in% > 0) .. "O|
00000190  53 5f 46 69 6c 65 22 2c  36 2c 70 61 74 68 25 20  |S_File",6,path% |
000001a0  3a 20 f4 20 64 65 6c 65  74 65 0d 00 aa 2f e7 20  |: . delete.../. |
000001b0  28 6f 75 74 25 20 3e 20  30 29 20 ff 28 22 53 65  |(out% > 0) .("Se|
000001c0  74 54 79 70 65 20 3c 57  69 6d 70 24 53 63 72 61  |tType <Wimp$Scra|
000001d0  70 3e 20 26 44 46 45 22  29 0d 00 b4 05 e0 0d 00  |p> &DFE").......|
000001e0  be 05 3a 0d 00 c8 09 dd  f2 45 53 53 0d 00 d2 2a  |..:......ESS...*|
000001f0  f2 67 65 74 62 6c 6f 63  6b 28 62 75 66 66 25 2c  |.getblock(buff%,|
00000200  34 2c 34 29 3a 76 65 72  73 69 6f 6e 25 20 3d 20  |4,4):version% = |
00000210  21 62 75 66 66 25 0d 00  dc 1d e7 20 76 65 72 73  |!buff%..... vers|
00000220  69 6f 6e 25 20 3c 20 31  31 30 20 f2 63 6c 6f 73  |ion% < 110 .clos|
00000230  65 3a e0 0d 00 e6 48 f2  6f 75 74 28 22 42 75 74  |e:....H.out("But|
00000240  74 6f 6e 20 74 65 78 74  2c 54 79 70 65 2c 4c 69  |ton text,Type,Li|
00000250  6e 6b 20 74 6f 2c 54 61  72 67 65 74 2f 69 64 65  |nk to,Target/ide|
00000260  6e 74 69 66 69 65 72 2f  63 6f 6d 6d 61 6e 64 22  |ntifier/command"|
00000270  2c 20 bd 28 31 30 29 2c  20 a3 29 0d 00 f0 0d d5  |, .(10), .).....|
00000280  23 6f 75 74 25 2c 31 30  0d 00 fa 28 f2 67 65 74  |#out%,10...(.get|
00000290  62 6c 6f 63 6b 28 62 75  66 66 25 2c 34 38 2c 34  |block(buff%,48,4|
000002a0  29 3a 74 6f 66 66 25 20  3d 20 21 62 75 66 66 25  |):toff% = !buff%|
000002b0  0d 01 04 29 f2 67 65 74  62 6c 6f 63 6b 28 62 75  |...).getblock(bu|
000002c0  66 66 25 2c 74 6f 66 66  25 2c 34 29 3a 74 6e 25  |ff%,toff%,4):tn%|
000002d0  20 3d 20 21 62 75 66 66  25 0d 01 0e 0e 74 6f 66  | = !buff%....tof|
000002e0  66 25 20 2b 3d 20 34 0d  01 18 12 e3 20 74 25 20  |f% += 4..... t% |
000002f0  3d 20 31 20 b8 20 74 6e  25 0d 01 22 1d f2 67 65  |= 1 . tn%.."..ge|
00000300  74 62 6c 6f 63 6b 28 62  75 66 66 25 2c 74 6f 66  |tblock(buff%,tof|
00000310  66 25 2c 32 34 29 0d 01  2c 0f 74 6f 66 66 25 20  |f%,24)..,.toff% |
00000320  2b 3d 20 32 34 0d 01 36  14 74 73 69 7a 65 25 20  |+= 24..6.tsize% |
00000330  3d 20 62 75 66 66 25 21  38 0d 01 40 47 f2 65 78  |= buff%!8..@G.ex|
00000340  74 72 61 63 74 6c 69 6e  6b 73 28 74 6f 66 66 25  |tractlinks(toff%|
00000350  2c 74 6f 66 66 25 2b 74  73 69 7a 65 25 2c 74 6f  |,toff%+tsize%,to|
00000360  66 66 25 2b 28 62 75 66  66 25 21 31 32 29 2c 74  |ff%+(buff%!12),t|
00000370  6f 66 66 25 2b 28 62 75  66 66 25 21 31 36 29 29  |off%+(buff%!16))|
00000380  0d 01 4a 13 74 6f 66 66  25 20 2b 3d 20 74 73 69  |..J.toff% += tsi|
00000390  7a 65 25 0d 01 54 05 ed  0d 01 5e 05 e1 0d 01 68  |ze%..T....^....h|
000003a0  05 3a 0d 01 72 0d dd f2  67 65 74 70 61 74 68 0d  |.:..r...getpath.|
000003b0  01 7c 25 f4 20 47 65 74  20 66 69 6c 65 20 70 61  |.|%. Get file pa|
000003c0  74 68 20 66 72 6f 6d 20  63 6f 6d 6d 61 6e 64 20  |th from command |
000003d0  6c 69 6e 65 0d 01 86 10  ea 20 63 25 2c 20 70 25  |line..... c%, p%|
000003e0  2c 20 69 25 0d 01 90 17  c8 99 20 22 4f 53 5f 47  |, i%...... "OS_G|
000003f0  65 74 45 6e 76 22 20 b8  20 63 25 0d 01 9a 0e 70  |etEnv" . c%....p|
00000400  25 20 3d 20 70 61 74 68  25 0d 01 a4 05 f5 0d 01  |% = path%.......|
00000410  ae 0c 69 25 20 3d 20 3f  63 25 0d 01 b8 1c e7 20  |..i% = ?c%..... |
00000420  28 69 25 20 3d 20 33 32  29 20 8c 20 70 25 20 3d  |(i% = 32) . p% =|
00000430  20 70 61 74 68 25 0d 01  c2 23 e7 20 28 69 25 20  | path%...#. (i% |
00000440  3e 20 33 32 29 20 8c 20  3f 70 25 20 3d 20 69 25  |> 32) . ?p% = i%|
00000450  3a 20 70 25 20 2b 3d 20  31 0d 01 cc 0b 63 25 20  |: p% += 1....c% |
00000460  2b 3d 20 31 0d 01 d6 0f  fd 20 28 69 25 20 3c 20  |+= 1..... (i% < |
00000470  33 32 29 0d 01 e0 0c 3f  70 25 20 3d 20 31 33 0d  |32)....?p% = 13.|
00000480  01 ea 05 e1 0d 01 f4 05  3a 0d 01 fe 25 dd f2 65  |........:...%..e|
00000490  78 74 72 61 63 74 6c 69  6e 6b 73 28 6f 66 66 25  |xtractlinks(off%|
000004a0  2c 65 6e 64 25 2c 63 73  25 2c 63 65 25 29 0d 02  |,end%,cs%,ce%)..|
000004b0  08 10 cf 23 69 6e 25 20  3d 20 6f 66 66 25 0d 02  |...#in% = off%..|
000004c0  12 13 c8 95 20 8f 23 69  6e 25 20 3c 20 65 6e 64  |.... .#in% < end|
000004d0  25 0d 02 1c 15 20 20 e7  20 8f 23 69 6e 25 20 3d  |%....  . .#in% =|
000004e0  20 63 73 25 20 8c 0d 02  26 13 20 20 20 20 cf 23  | cs% ...&.    .#|
000004f0  69 6e 25 20 3d 20 63 65  25 0d 02 30 07 20 20 cc  |in% = ce%..0.  .|
00000500  0d 02 3a 14 20 20 20 20  6f 66 66 25 20 3d 20 8f  |..:.    off% = .|
00000510  23 69 6e 25 0d 02 44 12  20 20 20 20 63 25 20 3d  |#in%..D.    c% =|
00000520  20 9a 23 69 6e 25 0d 02  4e 22 20 20 20 20 e7 20  | .#in%..N"    . |
00000530  28 63 25 20 3e 3d 20 31  34 29 20 80 20 28 63 25  |(c% >= 14) . (c%|
00000540  20 3c 20 33 32 29 20 8c  0d 02 58 19 20 20 20 20  | < 32) ...X.    |
00000550  20 20 6c 65 6e 67 74 68  25 20 3d 20 9a 23 69 6e  |  length% = .#in|
00000560  25 0d 02 62 25 20 20 20  20 20 20 e7 20 28 63 25  |%..b%      . (c%|
00000570  20 3d 20 31 38 29 20 80  20 28 9a 23 69 6e 25 20  | = 18) . (.#in% |
00000580  3d 20 35 29 20 8c 0d 02  6c 2e 20 20 20 20 20 20  |= 5) ...l.      |
00000590  20 20 f2 67 65 74 62 6c  6f 63 6b 28 68 62 75 66  |  .getblock(hbuf|
000005a0  66 25 2c 6f 66 66 25 2b  33 2c 6c 65 6e 67 74 68  |f%,off%+3,length|
000005b0  25 2d 35 29 0d 02 76 23  20 20 20 20 20 20 20 20  |%-5)..v#        |
000005c0  f2 6f 75 74 70 75 74 6c  69 6e 6b 73 28 6c 65 6e  |.outputlinks(len|
000005d0  67 74 68 25 2d 35 29 0d  02 80 0b 20 20 20 20 20  |gth%-5)....     |
000005e0  20 cd 0d 02 8a 20 20 20  20 20 20 20 cf 23 69 6e  | ....       .#in|
000005f0  25 20 3d 20 6f 66 66 25  20 2b 20 6c 65 6e 67 74  |% = off% + lengt|
00000600  68 25 0d 02 94 09 20 20  20 20 cd 0d 02 9e 07 20  |h%....    ..... |
00000610  20 cd 0d 02 a8 05 ce 0d  02 b2 05 e1 0d 02 bc 05  | ...............|
00000620  3a 0d 02 c6 17 dd f2 6f  75 74 70 75 74 6c 69 6e  |:......outputlin|
00000630  6b 73 28 6c 65 6e 25 29  0d 02 d0 20 74 79 70 65  |ks(len%)... type|
00000640  25 20 3d 20 3f 28 68 62  75 66 66 25 20 2b 20 6c  |% = ?(hbuff% + l|
00000650  65 6e 25 20 2d 20 31 29  0d 02 da 20 76 6c 65 6e  |en% - 1)... vlen|
00000660  25 20 3d 20 3f 28 68 62  75 66 66 25 20 2b 20 6c  |% = ?(hbuff% + l|
00000670  65 6e 25 20 2d 20 32 29  0d 02 e4 20 f2 6f 75 74  |en% - 2)... .out|
00000680  6e 28 68 62 75 66 66 25  2c 20 76 6c 65 6e 25 2c  |n(hbuff%, vlen%,|
00000690  20 22 2c 22 2c 20 b9 29  0d 02 ee 0e c8 8e 20 74  | ",", .)...... t|
000006a0  79 70 65 25 20 ca 0d 02  f8 0b 20 20 c9 20 32 35  |ype% .....  . 25|
000006b0  35 0d 03 02 21 20 20 20  20 f2 6f 75 74 28 22 52  |5...!    .out("R|
000006c0  65 66 65 72 65 6e 63 65  22 2c 20 22 2c 22 2c 20  |eference", ",", |
000006d0  b9 29 0d 03 0c 18 20 20  20 20 f2 6f 75 74 28 22  |.)....    .out("|
000006e0  22 2c 20 22 2c 22 2c 20  a3 29 0d 03 16 0a 20 20  |", ",", .)....  |
000006f0  c9 20 31 30 0d 03 20 1f  20 20 20 20 f2 6f 75 74  |. 10.. .    .out|
00000700  28 22 43 6f 6d 6d 61 6e  64 22 2c 20 22 2c 22 2c  |("Command", ",",|
00000710  20 b9 29 0d 03 2a 18 20  20 20 20 f2 6f 75 74 28  | .)..*.    .out(|
00000720  22 22 2c 20 22 2c 22 2c  20 a3 29 0d 03 34 07 20  |"", ",", .)..4. |
00000730  20 7f 0d 03 3e 3f 20 20  20 20 e7 20 28 28 74 79  | ...>?    . ((ty|
00000740  70 65 25 20 80 20 31 29  20 3d 20 31 29 20 70 6f  |pe% . 1) = 1) po|
00000750  73 24 20 3d 20 22 63 65  6e 74 72 65 22 20 8b 20  |s$ = "centre" . |
00000760  70 6f 73 24 20 3d 20 22  74 6f 70 20 6c 65 66 74  |pos$ = "top left|
00000770  22 0d 03 48 19 20 20 20  20 c8 8e 20 28 74 79 70  |"..H.    .. (typ|
00000780  65 25 20 3e 3e 20 31 29  20 ca 0d 03 52 0d 20 20  |e% >> 1) ...R.  |
00000790  20 20 20 20 c9 20 30 0d  03 5c 1a 20 20 20 20 20  |    . 0..\.     |
000007a0  20 20 20 74 79 70 65 24  20 3d 20 22 50 61 67 65  |   type$ = "Page|
000007b0  22 0d 03 66 0d 20 20 20  20 20 20 c9 20 31 0d 03  |"..f.      . 1..|
000007c0  70 1b 20 20 20 20 20 20  20 20 74 79 70 65 24 20  |p.        type$ |
000007d0  3d 20 22 46 72 61 6d 65  22 0d 03 7a 0d 20 20 20  |= "Frame"..z.   |
000007e0  20 20 20 c9 20 32 0d 03  84 1a 20 20 20 20 20 20  |   . 2....      |
000007f0  20 20 74 79 70 65 24 20  3d 20 22 54 65 78 74 22  |  type$ = "Text"|
00000800  0d 03 8e 0d 20 20 20 20  20 20 c9 20 33 0d 03 98  |....      . 3...|
00000810  25 20 20 20 20 20 20 20  20 74 79 70 65 24 20 3d  |%        type$ =|
00000820  20 22 52 65 66 65 72 65  6e 63 65 20 70 6f 69 6e  | "Reference poin|
00000830  74 22 0d 03 a2 0d 20 20  20 20 20 20 c9 20 34 0d  |t"....      . 4.|
00000840  03 ac 1e 20 20 20 20 20  20 20 20 74 79 70 65 24  |...        type$|
00000850  20 3d 20 22 44 6f 63 75  6d 65 6e 74 22 0d 03 b6  | = "Document"...|
00000860  09 20 20 20 20 cb 0d 03  c0 1c 20 20 20 20 f2 6f  |.    .....    .o|
00000870  75 74 28 22 4c 69 6e 6b  22 2c 20 22 2c 22 2c 20  |ut("Link", ",", |
00000880  b9 29 0d 03 ca 2c 20 20  20 20 f2 6f 75 74 28 74  |.)...,    .out(t|
00000890  79 70 65 24 2b 22 20 28  61 74 20 22 2b 70 6f 73  |ype$+" (at "+pos|
000008a0  24 2b 22 29 22 2c 20 22  2c 22 2c 20 b9 29 0d 03  |$+")", ",", .)..|
000008b0  d4 05 cb 0d 03 de 35 f2  6f 75 74 6e 28 68 62 75  |......5.outn(hbu|
000008c0  66 66 25 20 2b 20 76 6c  65 6e 25 2c 20 6c 65 6e  |ff% + vlen%, len|
000008d0  25 20 2d 20 76 6c 65 6e  25 20 2d 20 32 2c 20 bd  |% - vlen% - 2, .|
000008e0  28 31 30 29 2c 20 b9 29  0d 03 e8 05 e1 0d 03 f2  |(10), .)........|
000008f0  05 3a 0d 03 fc 24 dd f2  67 65 74 62 6c 6f 63 6b  |.:...$..getblock|
00000900  28 70 25 2c 20 6f 66 66  73 65 74 25 2c 20 6c 65  |(p%, offset%, le|
00000910  6e 67 74 68 25 29 0d 04  06 29 c8 99 20 22 4f 53  |ngth%)...).. "OS|
00000920  5f 47 42 50 42 22 2c 33  2c 69 6e 25 2c 70 25 2c  |_GBPB",3,in%,p%,|
00000930  6c 65 6e 67 74 68 25 2c  6f 66 66 73 65 74 25 0d  |length%,offset%.|
00000940  04 10 05 e1 0d 04 1a 05  3a 0d 04 24 15 dd f2 6f  |........:..$...o|
00000950  75 74 28 6f 24 2c 20 63  24 2c 20 71 25 29 0d 04  |ut(o$, c$, q%)..|
00000960  2e 2a f4 20 4f 75 74 70  75 74 20 73 74 72 69 6e  |.*. Output strin|
00000970  67 20 61 6e 64 20 74 65  72 6d 69 6e 61 74 6f 72  |g and terminator|
00000980  20 74 6f 20 66 69 6c 65  0d 04 38 10 24 6f 62 75  | to file..8.$obu|
00000990  66 66 25 20 3d 20 6f 24  0d 04 42 20 f2 6f 75 74  |ff% = o$..B .out|
000009a0  6e 28 6f 62 75 66 66 25  2c 20 a9 28 6f 24 29 2c  |n(obuff%, .(o$),|
000009b0  20 63 24 2c 20 71 25 29  0d 04 4c 05 e1 0d 04 56  | c$, q%)..L....V|
000009c0  05 3a 0d 04 60 1a dd f2  6f 75 74 6e 28 6f 25 2c  |.:..`...outn(o%,|
000009d0  20 6e 25 2c 20 63 24 2c  20 71 25 29 0d 04 6a 32  | n%, c$, q%)..j2|
000009e0  f4 20 4f 75 74 70 75 74  20 63 6f 75 6e 74 65 64  |. Output counted|
000009f0  20 73 74 72 69 6e 67 20  61 6e 64 20 74 65 72 6d  | string and term|
00000a00  69 6e 61 74 6f 72 20 74  6f 20 66 69 6c 65 0d 04  |inator to file..|
00000a10  74 25 f4 20 49 66 20 71  25 20 3d 20 54 52 55 45  |t%. If q% = TRUE|
00000a20  2c 20 65 6e 63 6c 6f 73  65 20 69 6e 20 71 75 6f  |, enclose in quo|
00000a30  74 65 73 0d 04 7e 08 ea  20 69 25 0d 04 88 12 e7  |tes..~.. i%.....|
00000a40  20 71 25 20 d5 23 6f 75  74 25 2c 33 34 0d 04 92  | q% .#out%,34...|
00000a50  10 e7 20 28 6e 25 20 3e  20 30 29 20 8c 0d 04 9c  |.. (n% > 0) ....|
00000a60  17 20 20 e3 20 69 25 20  3d 20 30 20 b8 20 6e 25  |.  . i% = 0 . n%|
00000a70  20 2d 20 31 0d 04 a6 17  20 20 d5 23 6f 75 74 25  | - 1....  .#out%|
00000a80  2c 3f 28 6f 25 20 2b 20  69 25 29 0d 04 b0 07 20  |,?(o% + i%).... |
00000a90  20 ed 0d 04 ba 05 cd 0d  04 c4 12 e7 20 71 25 20  | ........... q% |
00000aa0  d5 23 6f 75 74 25 2c 33  34 0d 04 ce 10 d5 23 6f  |.#out%,34.....#o|
00000ab0  75 74 25 2c 97 28 63 24  29 0d 04 d8 05 e1 0d 04  |ut%,.(c$).......|
00000ac0  e2 05 3a 0d 04 ec 0b dd  f2 63 6c 6f 73 65 0d 04  |..:......close..|
00000ad0  f6 13 e7 20 69 6e 25 20  3e 20 30 20 d9 23 69 6e  |... in% > 0 .#in|
00000ae0  25 0d 05 00 15 e7 20 6f  75 74 25 20 3e 20 30 20  |%..... out% > 0 |
00000af0  d9 23 6f 75 74 25 0d 05  0a 16 c8 99 20 22 48 6f  |.#out%...... "Ho|
00000b00  75 72 67 6c 61 73 73 5f  4f 66 66 22 0d 05 14 05  |urglass_Off"....|
00000b10  e1 0d ff                                          |...|
00000b13