Home » Archimedes archive » Acorn User » AU 1997-04 B.adf » PD » PDScheme/Newshound/NewsHound/NewsHound/newsgw

PDScheme/Newshound/NewsHound/NewsHound/newsgw

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 1997-04 B.adf » PD
Filename: PDScheme/Newshound/NewsHound/NewsHound/newsgw
Read OK:
File size: 0690 bytes
Load address: 0000
Exec address: 0000
File contents
   10ON ERROR PRINTREPORT$;" at ";ERL:END
   20in%=0:h$=""
   30d1$="<NewsHound$ConfigDir>"
   40SYS"XOS_File",17,d1$TOt%;F%
   50IFt%=0OR(F%AND1)<>0 PROCexit("NewsHound config dir not found")
   60
   70server$=""
   80server$=FNgetserver
  100host$=""
  110
  120IF server$<>"" THEN host$=FNgethost(d1$+"."+server$+"Group",type%)
  130
  140IFhost$>""THEN
  150  h$=host$
  160ENDIF
  170SYS"OS_CLI","set NewsBase$ReturnCode 0"
  180IF h$<>"" THEN
  190  SYS"OS_CLI","set NewsBase$ReturnInfo "+h$
  200  ELSE
  210  SYS"OS_CLI","unset NewsBase$ReturnInfo"
  220ENDIF
  230END
  240
  250DEFFNgetserver
  260LOCALa$,serv$
  270serv$=""
  280in%=FNopenin("<NewsHound$ConfigDir>.Config")
  290IFin%>0THEN
  300  REPEAT
  320    a$=GET$#in%
  330    a$=FNlower(a$)
  340    IF serv$="" AND LEFT$(a$,LEN("default:"))="default:" THEN
  350      a$=MID$(a$,LEN("default:")+1)
  360      WHILE LEFT$(a$,1)=" "
  370        a$=MID$(a$,2)
  380      ENDWHILE
  390      WHILE RIGHT$(a$)=" "
  400        a$=LEFT$(a$)
  410      ENDWHILE
  420      serv$=a$
  430    ENDIF
  440  UNTILEOF#in%
  450  PROCcf(in%)
  460ENDIF
  470=serv$
  480
  490
  500DEFFNgethost(f$,type%)
  510LOCALa$,host$,cnt%
  520cnt%=0:host$=""
  530in%=FNopenin(f$)
  540IFin%>0THEN
  550  REPEAT
  560    a$=GET$#in%
  570    IF LEFT$(a$,1)<>"#" THEN cnt%+=1
  580  UNTIL EOF#in% OR cnt%=2
  590  IF NOT EOF#in% THEN host$=a$
  600  PROCcf(in%)
  610ENDIF
  620=host$
  630
  640DEFFNopenin(f$)
  650LOCALh%,F%
  660SYS"XOS_Find",&4F,f$ TOh%;F%:IF(F%AND1)<>0THENh%=0
  670=h%
  680
  690DEFPROCcf(RETURN h%)
  700IFh%<>0 SYS"XOS_Find",0,h%:h%=0
  710ENDPROC
  720
  730DEFFNgetpar(RETURN A$,s$)
  740LOCALB$,l%
  750l%=INSTR(A$,s$)
  760IFl%>0THEN
  770  B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1)
  780  ELSE
  790  B$=A$:A$=""
  800ENDIF
  810=B$
  820
  830DEFFNend(a$)
  840l%=LENa$
  850REPEATl%=l%-1:UNTILMID$(a$,l%,1)=" "ORl%<=1
  860=MID$(a$,l%+1)
  870
  880DEFFNlower(A$)
  890LOCALB$,L%,C%:B$=""
  900FORL%=1TOLENA$:C%=ASC(MID$(A$,L%,1))
  910IFC%>64ANDC%<91 THENC%=C%+32
  920B$+=CHR$C%
  930NEXT:=B$
  940
  950DEFPROCexit(n%,a$)
  960PROCcf(in%)
  970OSCLI("set NewsBase$ReturnCode "+STR$n%)
  980OSCLI("set NewsBase$ReturnInfo "+a$)
  990END
 1000

� � �$;" at ";�:�
in%=0:h$=""
d1$="<NewsHound$ConfigDir>"
(ș"XOS_File",17,d1$�t%;F%
2;�t%=0�(F%�1)<>0 �exit("NewsHound config dir not found")
<
Fserver$=""
Pserver$=�getserver
dhost$=""
n
xA� server$<>"" � host$=�gethost(d1$+"."+server$+"Group",type%)
�
��host$>""�
�  h$=host$
��
�*ș"OS_CLI","set NewsBase$ReturnCode 0"
�� h$<>"" �
�.  ș"OS_CLI","set NewsBase$ReturnInfo "+h$
�  �
�,  ș"OS_CLI","unset NewsBase$ReturnInfo"
��
��
�
�ݤgetserver

�a$,serv$
serv$=""
/in%=�openin("<NewsHound$ConfigDir>.Config")
"�in%>0�
,  �
@    a$=�#in%
J    a$=�lower(a$)
T4    � serv$="" � �a$,�("default:"))="default:" �
^!      a$=�a$,�("default:")+1)
h      ȕ �a$,1)=" "
r        a$=�a$,2)
|      �
�      ȕ �a$)=" "
�        a$=�a$)
�      �
�      serv$=a$
�	    �
�  ��#in%
�  �cf(in%)
��
�
=serv$
�
�
�ݤgethost(f$,type%)
��a$,host$,cnt%
cnt%=0:host$=""
in%=�openin(f$)
�in%>0�
&  �
0    a$=�#in%
:    � �a$,1)<>"#" � cnt%+=1
D  � �#in% � cnt%=2
N  � � �#in% � host$=a$
X  �cf(in%)
b�
l
=host$
v
�ݤopenin(f$)
�
�h%,F%
�.ș"XOS_Find",&4F,f$ �h%;F%:�(F%�1)<>0�h%=0
�=h%
�
���cf(� h%)
�!�h%<>0 ș"XOS_Find",0,h%:h%=0
��
�
�ݤgetpar(� A$,s$)
�
�B$,l%
�l%=�A$,s$)
�
�l%>0�
  B$=�A$,l%-1):A$=�A$,l%+1)
  �
  B$=A$:A$=""
 �
*=B$
4
>
ݤend(a$)
H
l%=�a$
R!�l%=l%-1:��a$,l%,1)=" "�l%<=1
\=�a$,l%+1)
f
pݤlower(A$)
z�B$,L%,C%:B$=""
��L%=1��A$:C%=�(�A$,L%,1))
��C%>64�C%<91 �C%=C%+32
�B$+=�C%
�	�:=B$
�
���exit(n%,a$)
��cf(in%)
�%�("set NewsBase$ReturnCode "+�n%)
�$�("set NewsBase$ReturnInfo "+a$)
��
�
�
00000000  0d 00 0a 16 ee 20 85 20  f1 f6 24 3b 22 20 61 74  |..... . ..$;" at|
00000010  20 22 3b 9e 3a e0 0d 00  14 0f 69 6e 25 3d 30 3a  | ";.:.....in%=0:|
00000020  68 24 3d 22 22 0d 00 1e  1f 64 31 24 3d 22 3c 4e  |h$=""....d1$="<N|
00000030  65 77 73 48 6f 75 6e 64  24 43 6f 6e 66 69 67 44  |ewsHound$ConfigD|
00000040  69 72 3e 22 0d 00 28 1d  c8 99 22 58 4f 53 5f 46  |ir>"..(..."XOS_F|
00000050  69 6c 65 22 2c 31 37 2c  64 31 24 b8 74 25 3b 46  |ile",17,d1$.t%;F|
00000060  25 0d 00 32 3b e7 74 25  3d 30 84 28 46 25 80 31  |%..2;.t%=0.(F%.1|
00000070  29 3c 3e 30 20 f2 65 78  69 74 28 22 4e 65 77 73  |)<>0 .exit("News|
00000080  48 6f 75 6e 64 20 63 6f  6e 66 69 67 20 64 69 72  |Hound config dir|
00000090  20 6e 6f 74 20 66 6f 75  6e 64 22 29 0d 00 3c 04  | not found")..<.|
000000a0  0d 00 46 0e 73 65 72 76  65 72 24 3d 22 22 0d 00  |..F.server$=""..|
000000b0  50 16 73 65 72 76 65 72  24 3d a4 67 65 74 73 65  |P.server$=.getse|
000000c0  72 76 65 72 0d 00 64 0c  68 6f 73 74 24 3d 22 22  |rver..d.host$=""|
000000d0  0d 00 6e 04 0d 00 78 41  e7 20 73 65 72 76 65 72  |..n...xA. server|
000000e0  24 3c 3e 22 22 20 8c 20  68 6f 73 74 24 3d a4 67  |$<>"" . host$=.g|
000000f0  65 74 68 6f 73 74 28 64  31 24 2b 22 2e 22 2b 73  |ethost(d1$+"."+s|
00000100  65 72 76 65 72 24 2b 22  47 72 6f 75 70 22 2c 74  |erver$+"Group",t|
00000110  79 70 65 25 29 0d 00 82  04 0d 00 8c 0e e7 68 6f  |ype%).........ho|
00000120  73 74 24 3e 22 22 8c 0d  00 96 0e 20 20 68 24 3d  |st$>"".....  h$=|
00000130  68 6f 73 74 24 0d 00 a0  05 cd 0d 00 aa 2a c8 99  |host$........*..|
00000140  22 4f 53 5f 43 4c 49 22  2c 22 73 65 74 20 4e 65  |"OS_CLI","set Ne|
00000150  77 73 42 61 73 65 24 52  65 74 75 72 6e 43 6f 64  |wsBase$ReturnCod|
00000160  65 20 30 22 0d 00 b4 0e  e7 20 68 24 3c 3e 22 22  |e 0"..... h$<>""|
00000170  20 8c 0d 00 be 2e 20 20  c8 99 22 4f 53 5f 43 4c  | .....  .."OS_CL|
00000180  49 22 2c 22 73 65 74 20  4e 65 77 73 42 61 73 65  |I","set NewsBase|
00000190  24 52 65 74 75 72 6e 49  6e 66 6f 20 22 2b 68 24  |$ReturnInfo "+h$|
000001a0  0d 00 c8 07 20 20 cc 0d  00 d2 2c 20 20 c8 99 22  |....  ....,  .."|
000001b0  4f 53 5f 43 4c 49 22 2c  22 75 6e 73 65 74 20 4e  |OS_CLI","unset N|
000001c0  65 77 73 42 61 73 65 24  52 65 74 75 72 6e 49 6e  |ewsBase$ReturnIn|
000001d0  66 6f 22 0d 00 dc 05 cd  0d 00 e6 05 e0 0d 00 f0  |fo".............|
000001e0  04 0d 00 fa 0f dd a4 67  65 74 73 65 72 76 65 72  |.......getserver|
000001f0  0d 01 04 0d ea 61 24 2c  73 65 72 76 24 0d 01 0e  |.....a$,serv$...|
00000200  0c 73 65 72 76 24 3d 22  22 0d 01 18 2f 69 6e 25  |.serv$="".../in%|
00000210  3d a4 6f 70 65 6e 69 6e  28 22 3c 4e 65 77 73 48  |=.openin("<NewsH|
00000220  6f 75 6e 64 24 43 6f 6e  66 69 67 44 69 72 3e 2e  |ound$ConfigDir>.|
00000230  43 6f 6e 66 69 67 22 29  0d 01 22 0b e7 69 6e 25  |Config").."..in%|
00000240  3e 30 8c 0d 01 2c 07 20  20 f5 0d 01 40 10 20 20  |>0...,.  ...@.  |
00000250  20 20 61 24 3d be 23 69  6e 25 0d 01 4a 15 20 20  |  a$=.#in%..J.  |
00000260  20 20 61 24 3d a4 6c 6f  77 65 72 28 61 24 29 0d  |  a$=.lower(a$).|
00000270  01 54 34 20 20 20 20 e7  20 73 65 72 76 24 3d 22  |.T4    . serv$="|
00000280  22 20 80 20 c0 61 24 2c  a9 28 22 64 65 66 61 75  |" . .a$,.("defau|
00000290  6c 74 3a 22 29 29 3d 22  64 65 66 61 75 6c 74 3a  |lt:"))="default:|
000002a0  22 20 8c 0d 01 5e 21 20  20 20 20 20 20 61 24 3d  |" ...^!      a$=|
000002b0  c1 61 24 2c a9 28 22 64  65 66 61 75 6c 74 3a 22  |.a$,.("default:"|
000002c0  29 2b 31 29 0d 01 68 17  20 20 20 20 20 20 c8 95  |)+1)..h.      ..|
000002d0  20 c0 61 24 2c 31 29 3d  22 20 22 0d 01 72 15 20  | .a$,1)=" "..r. |
000002e0  20 20 20 20 20 20 20 61  24 3d c1 61 24 2c 32 29  |       a$=.a$,2)|
000002f0  0d 01 7c 0b 20 20 20 20  20 20 ce 0d 01 86 15 20  |..|.      ..... |
00000300  20 20 20 20 20 c8 95 20  c2 61 24 29 3d 22 20 22  |     .. .a$)=" "|
00000310  0d 01 90 13 20 20 20 20  20 20 20 20 61 24 3d c0  |....        a$=.|
00000320  61 24 29 0d 01 9a 0b 20  20 20 20 20 20 ce 0d 01  |a$)....      ...|
00000330  a4 12 20 20 20 20 20 20  73 65 72 76 24 3d 61 24  |..      serv$=a$|
00000340  0d 01 ae 09 20 20 20 20  cd 0d 01 b8 0c 20 20 fd  |....    .....  .|
00000350  c5 23 69 6e 25 0d 01 c2  0e 20 20 f2 63 66 28 69  |.#in%....  .cf(i|
00000360  6e 25 29 0d 01 cc 05 cd  0d 01 d6 0a 3d 73 65 72  |n%).........=ser|
00000370  76 24 0d 01 e0 04 0d 01  ea 04 0d 01 f4 17 dd a4  |v$..............|
00000380  67 65 74 68 6f 73 74 28  66 24 2c 74 79 70 65 25  |gethost(f$,type%|
00000390  29 0d 01 fe 12 ea 61 24  2c 68 6f 73 74 24 2c 63  |).....a$,host$,c|
000003a0  6e 74 25 0d 02 08 13 63  6e 74 25 3d 30 3a 68 6f  |nt%....cnt%=0:ho|
000003b0  73 74 24 3d 22 22 0d 02  12 13 69 6e 25 3d a4 6f  |st$=""....in%=.o|
000003c0  70 65 6e 69 6e 28 66 24  29 0d 02 1c 0b e7 69 6e  |penin(f$).....in|
000003d0  25 3e 30 8c 0d 02 26 07  20 20 f5 0d 02 30 10 20  |%>0...&.  ...0. |
000003e0  20 20 20 61 24 3d be 23  69 6e 25 0d 02 3a 1f 20  |   a$=.#in%..:. |
000003f0  20 20 20 e7 20 c0 61 24  2c 31 29 3c 3e 22 23 22  |   . .a$,1)<>"#"|
00000400  20 8c 20 63 6e 74 25 2b  3d 31 0d 02 44 16 20 20  | . cnt%+=1..D.  |
00000410  fd 20 c5 23 69 6e 25 20  84 20 63 6e 74 25 3d 32  |. .#in% . cnt%=2|
00000420  0d 02 4e 1a 20 20 e7 20  ac 20 c5 23 69 6e 25 20  |..N.  . . .#in% |
00000430  8c 20 68 6f 73 74 24 3d  61 24 0d 02 58 0e 20 20  |. host$=a$..X.  |
00000440  f2 63 66 28 69 6e 25 29  0d 02 62 05 cd 0d 02 6c  |.cf(in%)..b....l|
00000450  0a 3d 68 6f 73 74 24 0d  02 76 04 0d 02 80 10 dd  |.=host$..v......|
00000460  a4 6f 70 65 6e 69 6e 28  66 24 29 0d 02 8a 0a ea  |.openin(f$).....|
00000470  68 25 2c 46 25 0d 02 94  2e c8 99 22 58 4f 53 5f  |h%,F%......"XOS_|
00000480  46 69 6e 64 22 2c 26 34  46 2c 66 24 20 b8 68 25  |Find",&4F,f$ .h%|
00000490  3b 46 25 3a e7 28 46 25  80 31 29 3c 3e 30 8c 68  |;F%:.(F%.1)<>0.h|
000004a0  25 3d 30 0d 02 9e 07 3d  68 25 0d 02 a8 04 0d 02  |%=0....=h%......|
000004b0  b2 0e dd f2 63 66 28 f8  20 68 25 29 0d 02 bc 21  |....cf(. h%)...!|
000004c0  e7 68 25 3c 3e 30 20 c8  99 22 58 4f 53 5f 46 69  |.h%<>0 .."XOS_Fi|
000004d0  6e 64 22 2c 30 2c 68 25  3a 68 25 3d 30 0d 02 c6  |nd",0,h%:h%=0...|
000004e0  05 e1 0d 02 d0 04 0d 02  da 15 dd a4 67 65 74 70  |............getp|
000004f0  61 72 28 f8 20 41 24 2c  73 24 29 0d 02 e4 0a ea  |ar(. A$,s$).....|
00000500  42 24 2c 6c 25 0d 02 ee  0e 6c 25 3d a7 41 24 2c  |B$,l%....l%=.A$,|
00000510  73 24 29 0d 02 f8 0a e7  6c 25 3e 30 8c 0d 03 02  |s$).....l%>0....|
00000520  1f 20 20 42 24 3d c0 41  24 2c 6c 25 2d 31 29 3a  |.  B$=.A$,l%-1):|
00000530  41 24 3d c1 41 24 2c 6c  25 2b 31 29 0d 03 0c 07  |A$=.A$,l%+1)....|
00000540  20 20 cc 0d 03 16 11 20  20 42 24 3d 41 24 3a 41  |  .....  B$=A$:A|
00000550  24 3d 22 22 0d 03 20 05  cd 0d 03 2a 07 3d 42 24  |$="".. ....*.=B$|
00000560  0d 03 34 04 0d 03 3e 0d  dd a4 65 6e 64 28 61 24  |..4...>...end(a$|
00000570  29 0d 03 48 0a 6c 25 3d  a9 61 24 0d 03 52 21 f5  |)..H.l%=.a$..R!.|
00000580  6c 25 3d 6c 25 2d 31 3a  fd c1 61 24 2c 6c 25 2c  |l%=l%-1:..a$,l%,|
00000590  31 29 3d 22 20 22 84 6c  25 3c 3d 31 0d 03 5c 0e  |1)=" ".l%<=1..\.|
000005a0  3d c1 61 24 2c 6c 25 2b  31 29 0d 03 66 04 0d 03  |=.a$,l%+1)..f...|
000005b0  70 0f dd a4 6c 6f 77 65  72 28 41 24 29 0d 03 7a  |p...lower(A$)..z|
000005c0  13 ea 42 24 2c 4c 25 2c  43 25 3a 42 24 3d 22 22  |..B$,L%,C%:B$=""|
000005d0  0d 03 84 1d e3 4c 25 3d  31 b8 a9 41 24 3a 43 25  |.....L%=1..A$:C%|
000005e0  3d 97 28 c1 41 24 2c 4c  25 2c 31 29 29 0d 03 8e  |=.(.A$,L%,1))...|
000005f0  1a e7 43 25 3e 36 34 80  43 25 3c 39 31 20 8c 43  |..C%>64.C%<91 .C|
00000600  25 3d 43 25 2b 33 32 0d  03 98 0b 42 24 2b 3d bd  |%=C%+32....B$+=.|
00000610  43 25 0d 03 a2 09 ed 3a  3d 42 24 0d 03 ac 04 0d  |C%.....:=B$.....|
00000620  03 b6 11 dd f2 65 78 69  74 28 6e 25 2c 61 24 29  |.....exit(n%,a$)|
00000630  0d 03 c0 0c f2 63 66 28  69 6e 25 29 0d 03 ca 25  |.....cf(in%)...%|
00000640  ff 28 22 73 65 74 20 4e  65 77 73 42 61 73 65 24  |.("set NewsBase$|
00000650  52 65 74 75 72 6e 43 6f  64 65 20 22 2b c3 6e 25  |ReturnCode "+.n%|
00000660  29 0d 03 d4 24 ff 28 22  73 65 74 20 4e 65 77 73  |)...$.("set News|
00000670  42 61 73 65 24 52 65 74  75 72 6e 49 6e 66 6f 20  |Base$ReturnInfo |
00000680  22 2b 61 24 29 0d 03 de  05 e0 0d 03 e8 04 0d ff  |"+a$)...........|
00000690