Home » Archimedes archive » Acorn User » AU 1995-05.adf » !PhoneDay_PhoneDay » Quantum/!Executor/Sendtext

Quantum/!Executor/Sendtext

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-05.adf » !PhoneDay_PhoneDay
Filename: Quantum/!Executor/Sendtext
Read OK:
File size: 0484 bytes
Load address: 0000
Exec address: 0000
File contents
    1REM (v1.0) When run, the parameter text will be sent to Impression Style/Publisher at the caret of a page area.
    2
    3SYS "OS_GetEnv" TO command%
    4l%=0:c%=0
    5REPEAT
    6IF ?(command%+l%) = 34 THEN c%+=1
    7l%+=1
    8UNTIL c%>=2
    9pointer%=l%+1+command%
   10
   11l%=0:f%=FALSE
   12REPEAT
   13 l%+=1
   14 IF ?(pointer%+l%) = 0 THEN f%=TRUE
   15UNTIL f%=TRUE
   16endpointer%=pointer%+l%
   17
   18PROCinit
   19IF dest_hd% = -1 THEN PROCend
   20PROCpoll
   21PROCsendmessage
   22PROCend
   23END
   24:
   25DEFPROCend
   26SYS "OS_Exit"
   27END
   28
   29:
   30DEFPROCpoll
   31 SYS "Wimp_Poll",0,q% TO reason%
   32ENDPROC
   33:
   34DEFPROCsendmessage
   35text$="Enter "
   36buffer%!0=256
   37buffer%!16=&80E18
   38buffer%!24=taskhandle%
   39buffer%!20=0
   40buffer%?24=36
   41buffer%!25=0
   42buffer%!29=0
   43buffer%!33=0
   44FOR l%=1 TO LEN(text$)
   45buffer%?(35+l%)=ASCMID$(text$,l%,1)
   46NEXT
   47offset%=LEN(text$)+36
   48l%=0
   49REPEAT
   50 buffer%?(offset%+l%)=?(pointer%+l%)
   51 l%+=1
   52UNTIL (pointer%+l%) > endpointer%
   53
   54SYS "Wimp_SendMessage",17,buffer%,dest_hd%
   55REM SYS "Wimp_SendMessage",17,buffer%,0
   56
   57ENDPROC
   58:
   59DEFPROCinit
   60 DIM q% &400,buffer% 256
   61 SYS "Wimp_Initialise",200,&4B534154,"SendText" TO ,taskhandle%
   62 SYS "Wimp_GetCaretPosition",,buffer%
   63 dest_hd%=buffer%!0
   64ENDPROC
   65
q� (v1.0) When run, the parameter text will be sent to Impression Style/Publisher at the caret of a page area.

ș "OS_GetEnv" � command%

l%=0:c%=0
�
!� ?(command%+l%) = 34 � c%+=1
	l%+=1
� c%>=2
	pointer%=l%+1+command%



l%=0:f%=�
�

 l%+=1
  � ?(pointer%+l%) = 0 � f%=�

� f%=�
endpointer%=pointer%+l%

	�init
� dest_hd% = -1 � �end
	�poll
�sendmessage
�end
�
:
	��end
ș "OS_Exit"
�

:

��poll
" ș "Wimp_Poll",0,q% � reason%
 �
!:
"��sendmessage
#text$="Enter "
$buffer%!0=256
%buffer%!16=&80E18
&buffer%!24=taskhandle%
'buffer%!20=0
(buffer%?24=36
)buffer%!25=0
*buffer%!29=0
+buffer%!33=0
,� l%=1 � �(text$)
-!buffer%?(35+l%)=��text$,l%,1)
.�
/offset%=�(text$)+36
0l%=0
1�
2( buffer%?(offset%+l%)=?(pointer%+l%)
3
 l%+=1
4!� (pointer%+l%) > endpointer%
5
6-ș "Wimp_SendMessage",17,buffer%,dest_hd%
7)� SYS "Wimp_SendMessage",17,buffer%,0
8
9�
::
;
��init
< � q% &400,buffer% 256
=A ș "Wimp_Initialise",200,&4B534154,"SendText" � ,taskhandle%
>( ș "Wimp_GetCaretPosition",,buffer%
? dest_hd%=buffer%!0
@�
A
�
00000000  0d 00 01 71 f4 20 28 76  31 2e 30 29 20 57 68 65  |...q. (v1.0) Whe|
00000010  6e 20 72 75 6e 2c 20 74  68 65 20 70 61 72 61 6d  |n run, the param|
00000020  65 74 65 72 20 74 65 78  74 20 77 69 6c 6c 20 62  |eter text will b|
00000030  65 20 73 65 6e 74 20 74  6f 20 49 6d 70 72 65 73  |e sent to Impres|
00000040  73 69 6f 6e 20 53 74 79  6c 65 2f 50 75 62 6c 69  |sion Style/Publi|
00000050  73 68 65 72 20 61 74 20  74 68 65 20 63 61 72 65  |sher at the care|
00000060  74 20 6f 66 20 61 20 70  61 67 65 20 61 72 65 61  |t of a page area|
00000070  2e 0d 00 02 04 0d 00 03  1d c8 99 20 22 4f 53 5f  |........... "OS_|
00000080  47 65 74 45 6e 76 22 20  b8 20 63 6f 6d 6d 61 6e  |GetEnv" . comman|
00000090  64 25 0d 00 04 0d 6c 25  3d 30 3a 63 25 3d 30 0d  |d%....l%=0:c%=0.|
000000a0  00 05 05 f5 0d 00 06 21  e7 20 3f 28 63 6f 6d 6d  |.......!. ?(comm|
000000b0  61 6e 64 25 2b 6c 25 29  20 3d 20 33 34 20 8c 20  |and%+l%) = 34 . |
000000c0  63 25 2b 3d 31 0d 00 07  09 6c 25 2b 3d 31 0d 00  |c%+=1....l%+=1..|
000000d0  08 0b fd 20 63 25 3e 3d  32 0d 00 09 1a 70 6f 69  |... c%>=2....poi|
000000e0  6e 74 65 72 25 3d 6c 25  2b 31 2b 63 6f 6d 6d 61  |nter%=l%+1+comma|
000000f0  6e 64 25 0d 00 0a 04 0d  00 0b 0d 6c 25 3d 30 3a  |nd%........l%=0:|
00000100  66 25 3d a3 0d 00 0c 05  f5 0d 00 0d 0a 20 6c 25  |f%=.......... l%|
00000110  2b 3d 31 0d 00 0e 20 20  e7 20 3f 28 70 6f 69 6e  |+=1...  . ?(poin|
00000120  74 65 72 25 2b 6c 25 29  20 3d 20 30 20 8c 20 66  |ter%+l%) = 0 . f|
00000130  25 3d b9 0d 00 0f 0a fd  20 66 25 3d b9 0d 00 10  |%=...... f%=....|
00000140  1b 65 6e 64 70 6f 69 6e  74 65 72 25 3d 70 6f 69  |.endpointer%=poi|
00000150  6e 74 65 72 25 2b 6c 25  0d 00 11 04 0d 00 12 09  |nter%+l%........|
00000160  f2 69 6e 69 74 0d 00 13  1a e7 20 64 65 73 74 5f  |.init..... dest_|
00000170  68 64 25 20 3d 20 2d 31  20 8c 20 f2 65 6e 64 0d  |hd% = -1 . .end.|
00000180  00 14 09 f2 70 6f 6c 6c  0d 00 15 10 f2 73 65 6e  |....poll.....sen|
00000190  64 6d 65 73 73 61 67 65  0d 00 16 08 f2 65 6e 64  |dmessage.....end|
000001a0  0d 00 17 05 e0 0d 00 18  05 3a 0d 00 19 09 dd f2  |.........:......|
000001b0  65 6e 64 0d 00 1a 10 c8  99 20 22 4f 53 5f 45 78  |end...... "OS_Ex|
000001c0  69 74 22 0d 00 1b 05 e0  0d 00 1c 04 0d 00 1d 05  |it".............|
000001d0  3a 0d 00 1e 0a dd f2 70  6f 6c 6c 0d 00 1f 22 20  |:......poll..." |
000001e0  c8 99 20 22 57 69 6d 70  5f 50 6f 6c 6c 22 2c 30  |.. "Wimp_Poll",0|
000001f0  2c 71 25 20 b8 20 72 65  61 73 6f 6e 25 0d 00 20  |,q% . reason%.. |
00000200  05 e1 0d 00 21 05 3a 0d  00 22 11 dd f2 73 65 6e  |....!.:.."...sen|
00000210  64 6d 65 73 73 61 67 65  0d 00 23 12 74 65 78 74  |dmessage..#.text|
00000220  24 3d 22 45 6e 74 65 72  20 22 0d 00 24 11 62 75  |$="Enter "..$.bu|
00000230  66 66 65 72 25 21 30 3d  32 35 36 0d 00 25 15 62  |ffer%!0=256..%.b|
00000240  75 66 66 65 72 25 21 31  36 3d 26 38 30 45 31 38  |uffer%!16=&80E18|
00000250  0d 00 26 1a 62 75 66 66  65 72 25 21 32 34 3d 74  |..&.buffer%!24=t|
00000260  61 73 6b 68 61 6e 64 6c  65 25 0d 00 27 10 62 75  |askhandle%..'.bu|
00000270  66 66 65 72 25 21 32 30  3d 30 0d 00 28 11 62 75  |ffer%!20=0..(.bu|
00000280  66 66 65 72 25 3f 32 34  3d 33 36 0d 00 29 10 62  |ffer%?24=36..).b|
00000290  75 66 66 65 72 25 21 32  35 3d 30 0d 00 2a 10 62  |uffer%!25=0..*.b|
000002a0  75 66 66 65 72 25 21 32  39 3d 30 0d 00 2b 10 62  |uffer%!29=0..+.b|
000002b0  75 66 66 65 72 25 21 33  33 3d 30 0d 00 2c 15 e3  |uffer%!33=0..,..|
000002c0  20 6c 25 3d 31 20 b8 20  a9 28 74 65 78 74 24 29  | l%=1 . .(text$)|
000002d0  0d 00 2d 21 62 75 66 66  65 72 25 3f 28 33 35 2b  |..-!buffer%?(35+|
000002e0  6c 25 29 3d 97 c1 74 65  78 74 24 2c 6c 25 2c 31  |l%)=..text$,l%,1|
000002f0  29 0d 00 2e 05 ed 0d 00  2f 17 6f 66 66 73 65 74  |)......./.offset|
00000300  25 3d a9 28 74 65 78 74  24 29 2b 33 36 0d 00 30  |%=.(text$)+36..0|
00000310  08 6c 25 3d 30 0d 00 31  05 f5 0d 00 32 28 20 62  |.l%=0..1....2( b|
00000320  75 66 66 65 72 25 3f 28  6f 66 66 73 65 74 25 2b  |uffer%?(offset%+|
00000330  6c 25 29 3d 3f 28 70 6f  69 6e 74 65 72 25 2b 6c  |l%)=?(pointer%+l|
00000340  25 29 0d 00 33 0a 20 6c  25 2b 3d 31 0d 00 34 21  |%)..3. l%+=1..4!|
00000350  fd 20 28 70 6f 69 6e 74  65 72 25 2b 6c 25 29 20  |. (pointer%+l%) |
00000360  3e 20 65 6e 64 70 6f 69  6e 74 65 72 25 0d 00 35  |> endpointer%..5|
00000370  04 0d 00 36 2d c8 99 20  22 57 69 6d 70 5f 53 65  |...6-.. "Wimp_Se|
00000380  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 62 75  |ndMessage",17,bu|
00000390  66 66 65 72 25 2c 64 65  73 74 5f 68 64 25 0d 00  |ffer%,dest_hd%..|
000003a0  37 29 f4 20 53 59 53 20  22 57 69 6d 70 5f 53 65  |7). SYS "Wimp_Se|
000003b0  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 62 75  |ndMessage",17,bu|
000003c0  66 66 65 72 25 2c 30 0d  00 38 04 0d 00 39 05 e1  |ffer%,0..8...9..|
000003d0  0d 00 3a 05 3a 0d 00 3b  0a dd f2 69 6e 69 74 0d  |..:.:..;...init.|
000003e0  00 3c 1a 20 de 20 71 25  20 26 34 30 30 2c 62 75  |.<. . q% &400,bu|
000003f0  66 66 65 72 25 20 32 35  36 0d 00 3d 41 20 c8 99  |ffer% 256..=A ..|
00000400  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
00000410  65 22 2c 32 30 30 2c 26  34 42 35 33 34 31 35 34  |e",200,&4B534154|
00000420  2c 22 53 65 6e 64 54 65  78 74 22 20 b8 20 2c 74  |,"SendText" . ,t|
00000430  61 73 6b 68 61 6e 64 6c  65 25 0d 00 3e 28 20 c8  |askhandle%..>( .|
00000440  99 20 22 57 69 6d 70 5f  47 65 74 43 61 72 65 74  |. "Wimp_GetCaret|
00000450  50 6f 73 69 74 69 6f 6e  22 2c 2c 62 75 66 66 65  |Position",,buffe|
00000460  72 25 0d 00 3f 17 20 64  65 73 74 5f 68 64 25 3d  |r%..?. dest_hd%=|
00000470  62 75 66 66 65 72 25 21  30 0d 00 40 05 e1 0d 00  |buffer%!0..@....|
00000480  41 04 0d ff                                       |A...|
00000484