Home » Archimedes archive » Acorn User » AU 1995-10.adf » !Direct » Director/!Director/Menus/System/DoClose

Director/!Director/Menus/System/DoClose

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 » Acorn User » AU 1995-10.adf » !Direct
Filename: Director/!Director/Menus/System/DoClose
Read OK:
File size: 08D7 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
    1REM >Director:Menus.DoClose
    2
    3ON ERROR: ON ERROR OFF: ERROR ERR,REPORT$+" at "+STR$ERL
    4SYS "OS_GetEnv" TO in$
    5do$=FNarg(in$,"-do","")
    6
    7buffer_size%=1024
    8DIM buffer% buffer_size%
    9
   10window% = EVAL(FNread("Director$Window"))
   11icon% = EVAL(FNread("Director$Icon"))
   12
   13SYS "Wimp_Initialise",200,&4B534154,"Temp" TO ,handle%
   14
   15CASE do$ OF
   16  WHEN "Pin":
   17    PROCpin
   18    PROCclose
   19
   20  WHEN "Close":
   21    PROCclose
   22
   23  WHEN "Iconise":
   24    PROCiconise
   25
   26  OTHERWISE:
   27    ERROR 1,"Unknown operation '"+do$+"'"
   28ENDCASE
   29
   30SYS "Wimp_CloseDown",handle%,&4B534154
   31
   32END
   33
   34DEF PROCpin
   35    SYS "OS_Mouse" TO x%,y%
   36    path$=FNread("Path")
   37    IF path$="" THEN ERROR 1,"No path in this window"
   38    x%-=90
   39    IF x%<0 THEN x%=0
   40    OSCLI"Pin <path> "+STR$(x%)+" "+STR$(y%+45)
   41ENDPROC
   42
   43DEF PROCclose
   44  buffer%!0 = window%
   45  SYS "Wimp_SendMessage",3,buffer%,window%,icon%
   46ENDPROC
   47
   48DEF PROCiconise
   49  buffer%!0 = 20
   50  buffer%!4 = handle%
   51  buffer%!8 = 0
   52  buffer%!12 = 0
   53  buffer%!16 = 0
   54  
   55  SYS "Wimp_SendMessage",19,buffer%,window%,icon% TO ,,task_handle%
   56  
   57  buffer%!0 = window%
   58  SYS "Wimp_GetWindowInfo",,buffer% OR 1
   59  
   60  IF (buffer%!60) AND &100 THEN
   61    SYS "Wimp_TransferBlock",task_handle%,buffer%!76,handle%,buffer%,256
   62    title$ = FN0(buffer%)
   63  ELSE
   64    title$ = FN0(buffer%+76)
   65  ENDIF
   66  
   67  WHILE LEFT$(title$,1)=" "
   68    title$=MID$(title$,2)
   69  ENDWHILE
   70  
   71  a%=INSTR(title$," ")
   72  IF a% THEN title$=LEFT$(title$,a%-1)
   73  
   74  REPEAT
   75    a%=INSTR(title$,".")
   76    IF a% THEN title$=MID$(title$,a%+1)
   77  UNTIL a%=0
   78  
   79  buffer%!0 = 48
   80  buffer%!4 = handle%
   81  buffer%!8 = 1
   82  buffer%!12 = 0
   83  buffer%!16 = &400CA
   84  buffer%!20 = window%
   85  buffer%!24 = task_handle%
   86  $(buffer%+28) = RIGHT$(title$,19)
   87  
   88  REM R1+20 window handle
   89  REM R1+24 task handle for task which owns the window
   90  REM R1+28 20 Bytes of title string (last part of first word)
   91  REM R1+48
   92  
   93  SYS "Wimp_SendMessage",17,buffer%,0,0
   94ENDPROC
   95
   96DEF FNarg(str$,arg$,def$)
   97LOCAL i,j
   98i=INSTR(str$,arg$)
   99IF i=0 THEN =def$
  100i+=LENarg$+1
  101j=INSTR(str$+" <"," ",i)
  102=MID$(str$,i,j-i)
  103
  104DEF FNread(a$)
  105  ?buffer%=13
  106  SYS "XOS_ReadVarVal",a$,buffer%,buffer_size%,0,3 TO ,,read%
  107  buffer%?read%=13
  108=$buffer%
  109
  110DEF FN0(a%)
  111s$=""
  112WHILE ?a%>=32
  113 s$+=CHR$?a%
  114 a%+=1
  115ENDWHILE
  116=s$
� >Director:Menus.DoClose

 � �: � � �: � �,�$+" at "+Þ
ș "OS_GetEnv" � in$
do$=�arg(in$,"-do","")

buffer_size%=1024
� buffer% buffer_size%
	

)window% = �(�read("Director$Window"))
%icon% = �(�read("Director$Icon"))


8ș "Wimp_Initialise",200,&4B534154,"Temp" � ,handle%

Ȏ do$ �
  � "Pin":
    �pin
    �close

  � "Close":
    �close

  � "Iconise":
    �iconise

  :
)    � 1,"Unknown operation '"+do$+"'"
�

)ș "Wimp_CloseDown",handle%,&4B534154

 �
!
"
� �pin
#    ș "OS_Mouse" � x%,y%
$    path$=�read("Path")
%1    � path$="" � � 1,"No path in this window"
&    x%-=90
'    � x%<0 � x%=0
()    �"Pin <path> "+�(x%)+" "+�(y%+45)
)�
*
+� �close
,  buffer%!0 = window%
-3  ș "Wimp_SendMessage",3,buffer%,window%,icon%
.�
/
0� �iconise
1  buffer%!0 = 20
2  buffer%!4 = handle%
3  buffer%!8 = 0
4  buffer%!12 = 0
5  buffer%!16 = 0
6  
7E  ș "Wimp_SendMessage",19,buffer%,window%,icon% � ,,task_handle%
8  
9  buffer%!0 = window%
:*  ș "Wimp_GetWindowInfo",,buffer% � 1
;  
<  � (buffer%!60) � &100 �
=K    ș "Wimp_TransferBlock",task_handle%,buffer%!76,handle%,buffer%,256
>    title$ = �0(buffer%)
?  �
@    title$ = �0(buffer%+76)
A  �
B  
C  ȕ �title$,1)=" "
D    title$=�title$,2)
E  �
F  
G  a%=�title$," ")
H!  � a% � title$=�title$,a%-1)
I  
J  �
K    a%=�title$,".")
L#    � a% � title$=�title$,a%+1)
M  � a%=0
N  
O  buffer%!0 = 48
P  buffer%!4 = handle%
Q  buffer%!8 = 1
R  buffer%!12 = 0
S  buffer%!16 = &400CA
T  buffer%!20 = window%
U  buffer%!24 = task_handle%
V!  $(buffer%+28) = �title$,19)
W  
X  � R1+20 window handle
Y8  � R1+24 task handle for task which owns the window
Z@  � R1+28 20 Bytes of title string (last part of first word)
[
  � R1+48
\  
]*  ș "Wimp_SendMessage",17,buffer%,0,0
^�
_
`� �arg(str$,arg$,def$)
a	� i,j
bi=�str$,arg$)
c� i=0 � =def$
di+=�arg$+1
ej=�str$+" <"," ",i)
f=�str$,i,j-i)
g
h� �read(a$)
i  ?buffer%=13
j?  ș "XOS_ReadVarVal",a$,buffer%,buffer_size%,0,3 � ,,read%
k  buffer%?read%=13
l
=$buffer%
m
n� �0(a%)
o	s$=""
pȕ ?a%>=32
q
 s$+=�?a%
r
 a%+=1
s�
t=s$
�
00000000  0d 00 01 1d f4 20 3e 44  69 72 65 63 74 6f 72 3a  |..... >Director:|
00000010  4d 65 6e 75 73 2e 44 6f  43 6c 6f 73 65 0d 00 02  |Menus.DoClose...|
00000020  04 0d 00 03 20 ee 20 85  3a 20 ee 20 85 20 87 3a  |.... . .: . . .:|
00000030  20 85 20 9f 2c f6 24 2b  22 20 61 74 20 22 2b c3  | . .,.$+" at "+.|
00000040  9e 0d 00 04 18 c8 99 20  22 4f 53 5f 47 65 74 45  |....... "OS_GetE|
00000050  6e 76 22 20 b8 20 69 6e  24 0d 00 05 1a 64 6f 24  |nv" . in$....do$|
00000060  3d a4 61 72 67 28 69 6e  24 2c 22 2d 64 6f 22 2c  |=.arg(in$,"-do",|
00000070  22 22 29 0d 00 06 04 0d  00 07 15 62 75 66 66 65  |"")........buffe|
00000080  72 5f 73 69 7a 65 25 3d  31 30 32 34 0d 00 08 1a  |r_size%=1024....|
00000090  de 20 62 75 66 66 65 72  25 20 62 75 66 66 65 72  |. buffer% buffer|
000000a0  5f 73 69 7a 65 25 0d 00  09 04 0d 00 0a 29 77 69  |_size%.......)wi|
000000b0  6e 64 6f 77 25 20 3d 20  a0 28 a4 72 65 61 64 28  |ndow% = .(.read(|
000000c0  22 44 69 72 65 63 74 6f  72 24 57 69 6e 64 6f 77  |"Director$Window|
000000d0  22 29 29 0d 00 0b 25 69  63 6f 6e 25 20 3d 20 a0  |"))...%icon% = .|
000000e0  28 a4 72 65 61 64 28 22  44 69 72 65 63 74 6f 72  |(.read("Director|
000000f0  24 49 63 6f 6e 22 29 29  0d 00 0c 04 0d 00 0d 38  |$Icon")).......8|
00000100  c8 99 20 22 57 69 6d 70  5f 49 6e 69 74 69 61 6c  |.. "Wimp_Initial|
00000110  69 73 65 22 2c 32 30 30  2c 26 34 42 35 33 34 31  |ise",200,&4B5341|
00000120  35 34 2c 22 54 65 6d 70  22 20 b8 20 2c 68 61 6e  |54,"Temp" . ,han|
00000130  64 6c 65 25 0d 00 0e 04  0d 00 0f 0c c8 8e 20 64  |dle%.......... d|
00000140  6f 24 20 ca 0d 00 10 0e  20 20 c9 20 22 50 69 6e  |o$ .....  . "Pin|
00000150  22 3a 0d 00 11 0c 20 20  20 20 f2 70 69 6e 0d 00  |":....    .pin..|
00000160  12 0e 20 20 20 20 f2 63  6c 6f 73 65 0d 00 13 04  |..    .close....|
00000170  0d 00 14 10 20 20 c9 20  22 43 6c 6f 73 65 22 3a  |....  . "Close":|
00000180  0d 00 15 0e 20 20 20 20  f2 63 6c 6f 73 65 0d 00  |....    .close..|
00000190  16 04 0d 00 17 12 20 20  c9 20 22 49 63 6f 6e 69  |......  . "Iconi|
000001a0  73 65 22 3a 0d 00 18 10  20 20 20 20 f2 69 63 6f  |se":....    .ico|
000001b0  6e 69 73 65 0d 00 19 04  0d 00 1a 08 20 20 7f 3a  |nise........  .:|
000001c0  0d 00 1b 29 20 20 20 20  85 20 31 2c 22 55 6e 6b  |...)    . 1,"Unk|
000001d0  6e 6f 77 6e 20 6f 70 65  72 61 74 69 6f 6e 20 27  |nown operation '|
000001e0  22 2b 64 6f 24 2b 22 27  22 0d 00 1c 05 cb 0d 00  |"+do$+"'".......|
000001f0  1d 04 0d 00 1e 29 c8 99  20 22 57 69 6d 70 5f 43  |.....).. "Wimp_C|
00000200  6c 6f 73 65 44 6f 77 6e  22 2c 68 61 6e 64 6c 65  |loseDown",handle|
00000210  25 2c 26 34 42 35 33 34  31 35 34 0d 00 1f 04 0d  |%,&4B534154.....|
00000220  00 20 05 e0 0d 00 21 04  0d 00 22 0a dd 20 f2 70  |. ....!...".. .p|
00000230  69 6e 0d 00 23 1d 20 20  20 20 c8 99 20 22 4f 53  |in..#.    .. "OS|
00000240  5f 4d 6f 75 73 65 22 20  b8 20 78 25 2c 79 25 0d  |_Mouse" . x%,y%.|
00000250  00 24 1b 20 20 20 20 70  61 74 68 24 3d a4 72 65  |.$.    path$=.re|
00000260  61 64 28 22 50 61 74 68  22 29 0d 00 25 31 20 20  |ad("Path")..%1  |
00000270  20 20 e7 20 70 61 74 68  24 3d 22 22 20 8c 20 85  |  . path$="" . .|
00000280  20 31 2c 22 4e 6f 20 70  61 74 68 20 69 6e 20 74  | 1,"No path in t|
00000290  68 69 73 20 77 69 6e 64  6f 77 22 0d 00 26 0e 20  |his window"..&. |
000002a0  20 20 20 78 25 2d 3d 39  30 0d 00 27 15 20 20 20  |   x%-=90..'.   |
000002b0  20 e7 20 78 25 3c 30 20  8c 20 78 25 3d 30 0d 00  | . x%<0 . x%=0..|
000002c0  28 29 20 20 20 20 ff 22  50 69 6e 20 3c 70 61 74  |()    ."Pin <pat|
000002d0  68 3e 20 22 2b c3 28 78  25 29 2b 22 20 22 2b c3  |h> "+.(x%)+" "+.|
000002e0  28 79 25 2b 34 35 29 0d  00 29 05 e1 0d 00 2a 04  |(y%+45)..)....*.|
000002f0  0d 00 2b 0c dd 20 f2 63  6c 6f 73 65 0d 00 2c 19  |..+.. .close..,.|
00000300  20 20 62 75 66 66 65 72  25 21 30 20 3d 20 77 69  |  buffer%!0 = wi|
00000310  6e 64 6f 77 25 0d 00 2d  33 20 20 c8 99 20 22 57  |ndow%..-3  .. "W|
00000320  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00000330  2c 33 2c 62 75 66 66 65  72 25 2c 77 69 6e 64 6f  |,3,buffer%,windo|
00000340  77 25 2c 69 63 6f 6e 25  0d 00 2e 05 e1 0d 00 2f  |w%,icon%......./|
00000350  04 0d 00 30 0e dd 20 f2  69 63 6f 6e 69 73 65 0d  |...0.. .iconise.|
00000360  00 31 14 20 20 62 75 66  66 65 72 25 21 30 20 3d  |.1.  buffer%!0 =|
00000370  20 32 30 0d 00 32 19 20  20 62 75 66 66 65 72 25  | 20..2.  buffer%|
00000380  21 34 20 3d 20 68 61 6e  64 6c 65 25 0d 00 33 13  |!4 = handle%..3.|
00000390  20 20 62 75 66 66 65 72  25 21 38 20 3d 20 30 0d  |  buffer%!8 = 0.|
000003a0  00 34 14 20 20 62 75 66  66 65 72 25 21 31 32 20  |.4.  buffer%!12 |
000003b0  3d 20 30 0d 00 35 14 20  20 62 75 66 66 65 72 25  |= 0..5.  buffer%|
000003c0  21 31 36 20 3d 20 30 0d  00 36 06 20 20 0d 00 37  |!16 = 0..6.  ..7|
000003d0  45 20 20 c8 99 20 22 57  69 6d 70 5f 53 65 6e 64  |E  .. "Wimp_Send|
000003e0  4d 65 73 73 61 67 65 22  2c 31 39 2c 62 75 66 66  |Message",19,buff|
000003f0  65 72 25 2c 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |er%,window%,icon|
00000400  25 20 b8 20 2c 2c 74 61  73 6b 5f 68 61 6e 64 6c  |% . ,,task_handl|
00000410  65 25 0d 00 38 06 20 20  0d 00 39 19 20 20 62 75  |e%..8.  ..9.  bu|
00000420  66 66 65 72 25 21 30 20  3d 20 77 69 6e 64 6f 77  |ffer%!0 = window|
00000430  25 0d 00 3a 2a 20 20 c8  99 20 22 57 69 6d 70 5f  |%..:*  .. "Wimp_|
00000440  47 65 74 57 69 6e 64 6f  77 49 6e 66 6f 22 2c 2c  |GetWindowInfo",,|
00000450  62 75 66 66 65 72 25 20  84 20 31 0d 00 3b 06 20  |buffer% . 1..;. |
00000460  20 0d 00 3c 1d 20 20 e7  20 28 62 75 66 66 65 72  | ..<.  . (buffer|
00000470  25 21 36 30 29 20 80 20  26 31 30 30 20 8c 0d 00  |%!60) . &100 ...|
00000480  3d 4b 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 54  |=K    .. "Wimp_T|
00000490  72 61 6e 73 66 65 72 42  6c 6f 63 6b 22 2c 74 61  |ransferBlock",ta|
000004a0  73 6b 5f 68 61 6e 64 6c  65 25 2c 62 75 66 66 65  |sk_handle%,buffe|
000004b0  72 25 21 37 36 2c 68 61  6e 64 6c 65 25 2c 62 75  |r%!76,handle%,bu|
000004c0  66 66 65 72 25 2c 32 35  36 0d 00 3e 1c 20 20 20  |ffer%,256..>.   |
000004d0  20 74 69 74 6c 65 24 20  3d 20 a4 30 28 62 75 66  | title$ = .0(buf|
000004e0  66 65 72 25 29 0d 00 3f  07 20 20 cc 0d 00 40 1f  |fer%)..?.  ...@.|
000004f0  20 20 20 20 74 69 74 6c  65 24 20 3d 20 a4 30 28  |    title$ = .0(|
00000500  62 75 66 66 65 72 25 2b  37 36 29 0d 00 41 07 20  |buffer%+76)..A. |
00000510  20 cd 0d 00 42 06 20 20  0d 00 43 17 20 20 c8 95  | ...B.  ..C.  ..|
00000520  20 c0 74 69 74 6c 65 24  2c 31 29 3d 22 20 22 0d  | .title$,1)=" ".|
00000530  00 44 19 20 20 20 20 74  69 74 6c 65 24 3d c1 74  |.D.    title$=.t|
00000540  69 74 6c 65 24 2c 32 29  0d 00 45 07 20 20 ce 0d  |itle$,2)..E.  ..|
00000550  00 46 06 20 20 0d 00 47  15 20 20 61 25 3d a7 74  |.F.  ..G.  a%=.t|
00000560  69 74 6c 65 24 2c 22 20  22 29 0d 00 48 21 20 20  |itle$," ")..H!  |
00000570  e7 20 61 25 20 8c 20 74  69 74 6c 65 24 3d c0 74  |. a% . title$=.t|
00000580  69 74 6c 65 24 2c 61 25  2d 31 29 0d 00 49 06 20  |itle$,a%-1)..I. |
00000590  20 0d 00 4a 07 20 20 f5  0d 00 4b 17 20 20 20 20  | ..J.  ...K.    |
000005a0  61 25 3d a7 74 69 74 6c  65 24 2c 22 2e 22 29 0d  |a%=.title$,".").|
000005b0  00 4c 23 20 20 20 20 e7  20 61 25 20 8c 20 74 69  |.L#    . a% . ti|
000005c0  74 6c 65 24 3d c1 74 69  74 6c 65 24 2c 61 25 2b  |tle$=.title$,a%+|
000005d0  31 29 0d 00 4d 0c 20 20  fd 20 61 25 3d 30 0d 00  |1)..M.  . a%=0..|
000005e0  4e 06 20 20 0d 00 4f 14  20 20 62 75 66 66 65 72  |N.  ..O.  buffer|
000005f0  25 21 30 20 3d 20 34 38  0d 00 50 19 20 20 62 75  |%!0 = 48..P.  bu|
00000600  66 66 65 72 25 21 34 20  3d 20 68 61 6e 64 6c 65  |ffer%!4 = handle|
00000610  25 0d 00 51 13 20 20 62  75 66 66 65 72 25 21 38  |%..Q.  buffer%!8|
00000620  20 3d 20 31 0d 00 52 14  20 20 62 75 66 66 65 72  | = 1..R.  buffer|
00000630  25 21 31 32 20 3d 20 30  0d 00 53 19 20 20 62 75  |%!12 = 0..S.  bu|
00000640  66 66 65 72 25 21 31 36  20 3d 20 26 34 30 30 43  |ffer%!16 = &400C|
00000650  41 0d 00 54 1a 20 20 62  75 66 66 65 72 25 21 32  |A..T.  buffer%!2|
00000660  30 20 3d 20 77 69 6e 64  6f 77 25 0d 00 55 1f 20  |0 = window%..U. |
00000670  20 62 75 66 66 65 72 25  21 32 34 20 3d 20 74 61  | buffer%!24 = ta|
00000680  73 6b 5f 68 61 6e 64 6c  65 25 0d 00 56 21 20 20  |sk_handle%..V!  |
00000690  24 28 62 75 66 66 65 72  25 2b 32 38 29 20 3d 20  |$(buffer%+28) = |
000006a0  c2 74 69 74 6c 65 24 2c  31 39 29 0d 00 57 06 20  |.title$,19)..W. |
000006b0  20 0d 00 58 1b 20 20 f4  20 52 31 2b 32 30 20 77  | ..X.  . R1+20 w|
000006c0  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 00 59 38  |indow handle..Y8|
000006d0  20 20 f4 20 52 31 2b 32  34 20 74 61 73 6b 20 68  |  . R1+24 task h|
000006e0  61 6e 64 6c 65 20 66 6f  72 20 74 61 73 6b 20 77  |andle for task w|
000006f0  68 69 63 68 20 6f 77 6e  73 20 74 68 65 20 77 69  |hich owns the wi|
00000700  6e 64 6f 77 0d 00 5a 40  20 20 f4 20 52 31 2b 32  |ndow..Z@  . R1+2|
00000710  38 20 32 30 20 42 79 74  65 73 20 6f 66 20 74 69  |8 20 Bytes of ti|
00000720  74 6c 65 20 73 74 72 69  6e 67 20 28 6c 61 73 74  |tle string (last|
00000730  20 70 61 72 74 20 6f 66  20 66 69 72 73 74 20 77  | part of first w|
00000740  6f 72 64 29 0d 00 5b 0d  20 20 f4 20 52 31 2b 34  |ord)..[.  . R1+4|
00000750  38 0d 00 5c 06 20 20 0d  00 5d 2a 20 20 c8 99 20  |8..\.  ..]*  .. |
00000760  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00000770  65 22 2c 31 37 2c 62 75  66 66 65 72 25 2c 30 2c  |e",17,buffer%,0,|
00000780  30 0d 00 5e 05 e1 0d 00  5f 04 0d 00 60 1a dd 20  |0..^...._...`.. |
00000790  a4 61 72 67 28 73 74 72  24 2c 61 72 67 24 2c 64  |.arg(str$,arg$,d|
000007a0  65 66 24 29 0d 00 61 09  ea 20 69 2c 6a 0d 00 62  |ef$)..a.. i,j..b|
000007b0  11 69 3d a7 73 74 72 24  2c 61 72 67 24 29 0d 00  |.i=.str$,arg$)..|
000007c0  63 11 e7 20 69 3d 30 20  8c 20 3d 64 65 66 24 0d  |c.. i=0 . =def$.|
000007d0  00 64 0e 69 2b 3d a9 61  72 67 24 2b 31 0d 00 65  |.d.i+=.arg$+1..e|
000007e0  17 6a 3d a7 73 74 72 24  2b 22 20 3c 22 2c 22 20  |.j=.str$+" <"," |
000007f0  22 2c 69 29 0d 00 66 11  3d c1 73 74 72 24 2c 69  |",i)..f.=.str$,i|
00000800  2c 6a 2d 69 29 0d 00 67  04 0d 00 68 0f dd 20 a4  |,j-i)..g...h.. .|
00000810  72 65 61 64 28 61 24 29  0d 00 69 11 20 20 3f 62  |read(a$)..i.  ?b|
00000820  75 66 66 65 72 25 3d 31  33 0d 00 6a 3f 20 20 c8  |uffer%=13..j?  .|
00000830  99 20 22 58 4f 53 5f 52  65 61 64 56 61 72 56 61  |. "XOS_ReadVarVa|
00000840  6c 22 2c 61 24 2c 62 75  66 66 65 72 25 2c 62 75  |l",a$,buffer%,bu|
00000850  66 66 65 72 5f 73 69 7a  65 25 2c 30 2c 33 20 b8  |ffer_size%,0,3 .|
00000860  20 2c 2c 72 65 61 64 25  0d 00 6b 16 20 20 62 75  | ,,read%..k.  bu|
00000870  66 66 65 72 25 3f 72 65  61 64 25 3d 31 33 0d 00  |ffer%?read%=13..|
00000880  6c 0d 3d 24 62 75 66 66  65 72 25 0d 00 6d 04 0d  |l.=$buffer%..m..|
00000890  00 6e 0c dd 20 a4 30 28  61 25 29 0d 00 6f 09 73  |.n.. .0(a%)..o.s|
000008a0  24 3d 22 22 0d 00 70 0e  c8 95 20 3f 61 25 3e 3d  |$=""..p... ?a%>=|
000008b0  33 32 0d 00 71 0d 20 73  24 2b 3d bd 3f 61 25 0d  |32..q. s$+=.?a%.|
000008c0  00 72 0a 20 61 25 2b 3d  31 0d 00 73 05 ce 0d 00  |.r. a%+=1..s....|
000008d0  74 07 3d 73 24 0d ff                              |t.=s$..|
000008d7