Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/Transports/taylor/delgroup

StarterPak/!Newsbase/Transports/taylor/delgroup

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_199508.adf » !Internet
Filename: StarterPak/!Newsbase/Transports/taylor/delgroup
Read OK:
File size: 078F bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >delgroup
   20REM remove a group from the <NewsBase$TaylorConfig>.NewsBase.active file
   30REM
   40REM Author:         Gunnar ZREPORTtl
   50REM Date:           19-Sep-1994
   60REM Last modified:  13-Nov-1994
   70
   80ONERROR REPORT:PRINT" at line ";ERL:END
   90
  100LIBRARY "<NewsBase$TaylorDir>.ScriptLib"
  110
  120REM get the command line parameters.
  130PROCentry
  140IF (argc = 3) THEN
  150    IF argv$(1) = "-n" THEN
  160        N$ = argv$(2)
  170    ELSE
  180        PROCexit(1, "Invalid Parameters")
  190    ENDIF
  200ELSE
  210    PROCexit(1, "Invalid Parameters")
  220ENDIF
  230
  240REM remove spaces from group name
  250group$ = FNstripspaces(N$)
  260group$ = FNtolower(group$)
  270
  280path$ = FNgetenv("NewsBase$TaylorConfig")
  290IF path$ = "" THEN
  300    PROCexit(1, "NewsBase$TaylorConfig has not been found")
  330ENDIF
  340
  350IF FNobjtype(path$ + ".active") <> 0 THEN
  360    REM we make a copy of our current groups file. Then we copy that
  370    REM copy back line by line, inserting the new group where it
  380    REM lexically fits in.
  390    OSCLI ("copy " + path$ + ".active " + path$ + ".active~ F~C~V")
  400    in% = OPENIN(path$ + ".active~")
  410    IF in% = 0 THEN PROCexit(1, "could not open groups~ file")
  420    out% = OPENOUT(path$ + ".active")
  430    IF out% = 0 THEN PROCexit(1, "could not open groups file")
  440    o$ = GET$#in%
  450    WHILE o$ <> ""
  460        IF o$ <> group$ THEN
  470            BPUT #out%, o$
  480        ENDIF
  490        o$ = GET$#in%
  500    ENDWHILE
  510    CLOSE #in%
  520    CLOSE #out%
  530
  540    OSCLI ("settype " + path$ + ".active FFF")
  550ENDIF
  560
  570PROCexit(0, "Group added")
  580END
  590
  600REM convert all characters in a string to lowercase.
  610REM
  620DEF FNtolower(a$)
  630LOCAL i%, c$, cdiff
  640cdiff = ASC"a" - ASC"A"
  650FOR i% = 1 TO LENa$
  660    c$ = MID$(a$, i%, 1)
  670    IF c$ >= "A" AND c$ <= "Z" THEN
  680        MID$(a$, i%, 1) = CHR$(ASC(c$) + cdiff)
  690    ENDIF
  700= a$
  710
  720REM exit from here, returning appropriate info.
  730REM
  740DEFPROCexit(n%,a$)
  750OSCLI("set NewsBase$ReturnCode "+STR$n%)
  760OSCLI("set NewsBase$ReturnInfo "+a$)
  770END
  780ENDPROC
  790
  800DEFFNobjtype(f$)
  810LOCALF%
  820SYS"XOS_File",17,f$TOt%;F%
  830IF(F%AND1)THEN=-1:ELSE=t%

� >delgroup
J� remove a group from the <NewsBase$TaylorConfig>.NewsBase.active file
�
(!� Author:         Gunnar Z�tl
2!� Date:           19-Sep-1994
<!� Last modified:  13-Nov-1994
F
P� �:�" at line ";�:�
Z
d'ț "<NewsBase$TaylorDir>.ScriptLib"
n
x&� get the command line parameters.
�
�entry
�� (argc = 3) �
�    � argv$(1) = "-n" �
�        N$ = argv$(2)
�	    �
�*        �exit(1, "Invalid Parameters")
�	    �
��
�&    �exit(1, "Invalid Parameters")
��
�
�#� remove spaces from group name
�group$ = �stripspaces(N$)
group$ = �tolower(group$)

,path$ = �getenv("NewsBase$TaylorConfig")
"� path$ = "" �
,<    �exit(1, "NewsBase$TaylorConfig has not been found")
J�
T
^(� �objtype(path$ + ".active") <> 0 �
hF    � we make a copy of our current groups file. Then we copy that
rB    � copy back line by line, inserting the new group where it
|    � lexically fits in.
�C    � ("copy " + path$ + ".active " + path$ + ".active~ F~C~V")
�#    in% = �(path$ + ".active~")
�;    � in% = 0 � �exit(1, "could not open groups~ file")
�#    out% = �(path$ + ".active")
�;    � out% = 0 � �exit(1, "could not open groups file")
�    o$ = �#in%
�    ȕ o$ <> ""
�        � o$ <> group$ �
�            � #out%, o$
�
        �
�        o$ = �#in%
�	    �
�    � #in%
    � #out%

.    � ("settype " + path$ + ".active FFF")
&�
0
:�exit(0, "Group added")
D�
N
X6� convert all characters in a string to lowercase.
b�
l� �tolower(a$)
v� i%, c$, cdiff
�cdiff = �"a" - �"A"
�� i% = 1 � �a$
�    c$ = �a$, i%, 1)
�!    � c$ >= "A" � c$ <= "Z" �
�*        �a$, i%, 1) = �(�(c$) + cdiff)
�	    �
�= a$
�
�1� exit from here, returning appropriate info.
��
���exit(n%,a$)
�%�("set NewsBase$ReturnCode "+�n%)
�$�("set NewsBase$ReturnInfo "+a$)
�
�

 ݤobjtype(f$)
*�F%
4ș"XOS_File",17,f$�t%;F%
>�(F%�1)�=-1:�=t%
�
00000000  0d 00 0a 0f f4 20 3e 64  65 6c 67 72 6f 75 70 0d  |..... >delgroup.|
00000010  00 14 4a f4 20 72 65 6d  6f 76 65 20 61 20 67 72  |..J. remove a gr|
00000020  6f 75 70 20 66 72 6f 6d  20 74 68 65 20 3c 4e 65  |oup from the <Ne|
00000030  77 73 42 61 73 65 24 54  61 79 6c 6f 72 43 6f 6e  |wsBase$TaylorCon|
00000040  66 69 67 3e 2e 4e 65 77  73 42 61 73 65 2e 61 63  |fig>.NewsBase.ac|
00000050  74 69 76 65 20 66 69 6c  65 0d 00 1e 05 f4 0d 00  |tive file.......|
00000060  28 21 f4 20 41 75 74 68  6f 72 3a 20 20 20 20 20  |(!. Author:     |
00000070  20 20 20 20 47 75 6e 6e  61 72 20 5a f6 74 6c 0d  |    Gunnar Z.tl.|
00000080  00 32 21 f4 20 44 61 74  65 3a 20 20 20 20 20 20  |.2!. Date:      |
00000090  20 20 20 20 20 31 39 2d  53 65 70 2d 31 39 39 34  |     19-Sep-1994|
000000a0  0d 00 3c 21 f4 20 4c 61  73 74 20 6d 6f 64 69 66  |..<!. Last modif|
000000b0  69 65 64 3a 20 20 31 33  2d 4e 6f 76 2d 31 39 39  |ied:  13-Nov-199|
000000c0  34 0d 00 46 04 0d 00 50  19 ee 85 20 f6 3a f1 22  |4..F...P... .:."|
000000d0  20 61 74 20 6c 69 6e 65  20 22 3b 9e 3a e0 0d 00  | at line ";.:...|
000000e0  5a 04 0d 00 64 27 c8 9b  20 22 3c 4e 65 77 73 42  |Z...d'.. "<NewsB|
000000f0  61 73 65 24 54 61 79 6c  6f 72 44 69 72 3e 2e 53  |ase$TaylorDir>.S|
00000100  63 72 69 70 74 4c 69 62  22 0d 00 6e 04 0d 00 78  |criptLib"..n...x|
00000110  26 f4 20 67 65 74 20 74  68 65 20 63 6f 6d 6d 61  |&. get the comma|
00000120  6e 64 20 6c 69 6e 65 20  70 61 72 61 6d 65 74 65  |nd line paramete|
00000130  72 73 2e 0d 00 82 0a f2  65 6e 74 72 79 0d 00 8c  |rs......entry...|
00000140  12 e7 20 28 61 72 67 63  20 3d 20 33 29 20 8c 0d  |.. (argc = 3) ..|
00000150  00 96 1b 20 20 20 20 e7  20 61 72 67 76 24 28 31  |...    . argv$(1|
00000160  29 20 3d 20 22 2d 6e 22  20 8c 0d 00 a0 19 20 20  |) = "-n" .....  |
00000170  20 20 20 20 20 20 4e 24  20 3d 20 61 72 67 76 24  |      N$ = argv$|
00000180  28 32 29 0d 00 aa 09 20  20 20 20 cc 0d 00 b4 2a  |(2)....    ....*|
00000190  20 20 20 20 20 20 20 20  f2 65 78 69 74 28 31 2c  |        .exit(1,|
000001a0  20 22 49 6e 76 61 6c 69  64 20 50 61 72 61 6d 65  | "Invalid Parame|
000001b0  74 65 72 73 22 29 0d 00  be 09 20 20 20 20 cd 0d  |ters")....    ..|
000001c0  00 c8 05 cc 0d 00 d2 26  20 20 20 20 f2 65 78 69  |.......&    .exi|
000001d0  74 28 31 2c 20 22 49 6e  76 61 6c 69 64 20 50 61  |t(1, "Invalid Pa|
000001e0  72 61 6d 65 74 65 72 73  22 29 0d 00 dc 05 cd 0d  |rameters")......|
000001f0  00 e6 04 0d 00 f0 23 f4  20 72 65 6d 6f 76 65 20  |......#. remove |
00000200  73 70 61 63 65 73 20 66  72 6f 6d 20 67 72 6f 75  |spaces from grou|
00000210  70 20 6e 61 6d 65 0d 00  fa 1d 67 72 6f 75 70 24  |p name....group$|
00000220  20 3d 20 a4 73 74 72 69  70 73 70 61 63 65 73 28  | = .stripspaces(|
00000230  4e 24 29 0d 01 04 1d 67  72 6f 75 70 24 20 3d 20  |N$)....group$ = |
00000240  a4 74 6f 6c 6f 77 65 72  28 67 72 6f 75 70 24 29  |.tolower(group$)|
00000250  0d 01 0e 04 0d 01 18 2c  70 61 74 68 24 20 3d 20  |.......,path$ = |
00000260  a4 67 65 74 65 6e 76 28  22 4e 65 77 73 42 61 73  |.getenv("NewsBas|
00000270  65 24 54 61 79 6c 6f 72  43 6f 6e 66 69 67 22 29  |e$TaylorConfig")|
00000280  0d 01 22 12 e7 20 70 61  74 68 24 20 3d 20 22 22  |..".. path$ = ""|
00000290  20 8c 0d 01 2c 3c 20 20  20 20 f2 65 78 69 74 28  | ...,<    .exit(|
000002a0  31 2c 20 22 4e 65 77 73  42 61 73 65 24 54 61 79  |1, "NewsBase$Tay|
000002b0  6c 6f 72 43 6f 6e 66 69  67 20 68 61 73 20 6e 6f  |lorConfig has no|
000002c0  74 20 62 65 65 6e 20 66  6f 75 6e 64 22 29 0d 01  |t been found")..|
000002d0  4a 05 cd 0d 01 54 04 0d  01 5e 28 e7 20 a4 6f 62  |J....T...^(. .ob|
000002e0  6a 74 79 70 65 28 70 61  74 68 24 20 2b 20 22 2e  |jtype(path$ + ".|
000002f0  61 63 74 69 76 65 22 29  20 3c 3e 20 30 20 8c 0d  |active") <> 0 ..|
00000300  01 68 46 20 20 20 20 f4  20 77 65 20 6d 61 6b 65  |.hF    . we make|
00000310  20 61 20 63 6f 70 79 20  6f 66 20 6f 75 72 20 63  | a copy of our c|
00000320  75 72 72 65 6e 74 20 67  72 6f 75 70 73 20 66 69  |urrent groups fi|
00000330  6c 65 2e 20 54 68 65 6e  20 77 65 20 63 6f 70 79  |le. Then we copy|
00000340  20 74 68 61 74 0d 01 72  42 20 20 20 20 f4 20 63  | that..rB    . c|
00000350  6f 70 79 20 62 61 63 6b  20 6c 69 6e 65 20 62 79  |opy back line by|
00000360  20 6c 69 6e 65 2c 20 69  6e 73 65 72 74 69 6e 67  | line, inserting|
00000370  20 74 68 65 20 6e 65 77  20 67 72 6f 75 70 20 77  | the new group w|
00000380  68 65 72 65 20 69 74 0d  01 7c 1c 20 20 20 20 f4  |here it..|.    .|
00000390  20 6c 65 78 69 63 61 6c  6c 79 20 66 69 74 73 20  | lexically fits |
000003a0  69 6e 2e 0d 01 86 43 20  20 20 20 ff 20 28 22 63  |in....C    . ("c|
000003b0  6f 70 79 20 22 20 2b 20  70 61 74 68 24 20 2b 20  |opy " + path$ + |
000003c0  22 2e 61 63 74 69 76 65  20 22 20 2b 20 70 61 74  |".active " + pat|
000003d0  68 24 20 2b 20 22 2e 61  63 74 69 76 65 7e 20 46  |h$ + ".active~ F|
000003e0  7e 43 7e 56 22 29 0d 01  90 23 20 20 20 20 69 6e  |~C~V")...#    in|
000003f0  25 20 3d 20 8e 28 70 61  74 68 24 20 2b 20 22 2e  |% = .(path$ + ".|
00000400  61 63 74 69 76 65 7e 22  29 0d 01 9a 3b 20 20 20  |active~")...;   |
00000410  20 e7 20 69 6e 25 20 3d  20 30 20 8c 20 f2 65 78  | . in% = 0 . .ex|
00000420  69 74 28 31 2c 20 22 63  6f 75 6c 64 20 6e 6f 74  |it(1, "could not|
00000430  20 6f 70 65 6e 20 67 72  6f 75 70 73 7e 20 66 69  | open groups~ fi|
00000440  6c 65 22 29 0d 01 a4 23  20 20 20 20 6f 75 74 25  |le")...#    out%|
00000450  20 3d 20 ae 28 70 61 74  68 24 20 2b 20 22 2e 61  | = .(path$ + ".a|
00000460  63 74 69 76 65 22 29 0d  01 ae 3b 20 20 20 20 e7  |ctive")...;    .|
00000470  20 6f 75 74 25 20 3d 20  30 20 8c 20 f2 65 78 69  | out% = 0 . .exi|
00000480  74 28 31 2c 20 22 63 6f  75 6c 64 20 6e 6f 74 20  |t(1, "could not |
00000490  6f 70 65 6e 20 67 72 6f  75 70 73 20 66 69 6c 65  |open groups file|
000004a0  22 29 0d 01 b8 12 20 20  20 20 6f 24 20 3d 20 be  |")....    o$ = .|
000004b0  23 69 6e 25 0d 01 c2 13  20 20 20 20 c8 95 20 6f  |#in%....    .. o|
000004c0  24 20 3c 3e 20 22 22 0d  01 cc 1c 20 20 20 20 20  |$ <> ""....     |
000004d0  20 20 20 e7 20 6f 24 20  3c 3e 20 67 72 6f 75 70  |   . o$ <> group|
000004e0  24 20 8c 0d 01 d6 1b 20  20 20 20 20 20 20 20 20  |$ .....         |
000004f0  20 20 20 d5 20 23 6f 75  74 25 2c 20 6f 24 0d 01  |   . #out%, o$..|
00000500  e0 0d 20 20 20 20 20 20  20 20 cd 0d 01 ea 16 20  |..        ..... |
00000510  20 20 20 20 20 20 20 6f  24 20 3d 20 be 23 69 6e  |       o$ = .#in|
00000520  25 0d 01 f4 09 20 20 20  20 ce 0d 01 fe 0e 20 20  |%....    .....  |
00000530  20 20 d9 20 23 69 6e 25  0d 02 08 0f 20 20 20 20  |  . #in%....    |
00000540  d9 20 23 6f 75 74 25 0d  02 12 04 0d 02 1c 2e 20  |. #out%........ |
00000550  20 20 20 ff 20 28 22 73  65 74 74 79 70 65 20 22  |   . ("settype "|
00000560  20 2b 20 70 61 74 68 24  20 2b 20 22 2e 61 63 74  | + path$ + ".act|
00000570  69 76 65 20 46 46 46 22  29 0d 02 26 05 cd 0d 02  |ive FFF")..&....|
00000580  30 04 0d 02 3a 1b f2 65  78 69 74 28 30 2c 20 22  |0...:..exit(0, "|
00000590  47 72 6f 75 70 20 61 64  64 65 64 22 29 0d 02 44  |Group added")..D|
000005a0  05 e0 0d 02 4e 04 0d 02  58 36 f4 20 63 6f 6e 76  |....N...X6. conv|
000005b0  65 72 74 20 61 6c 6c 20  63 68 61 72 61 63 74 65  |ert all characte|
000005c0  72 73 20 69 6e 20 61 20  73 74 72 69 6e 67 20 74  |rs in a string t|
000005d0  6f 20 6c 6f 77 65 72 63  61 73 65 2e 0d 02 62 05  |o lowercase...b.|
000005e0  f4 0d 02 6c 12 dd 20 a4  74 6f 6c 6f 77 65 72 28  |...l.. .tolower(|
000005f0  61 24 29 0d 02 76 13 ea  20 69 25 2c 20 63 24 2c  |a$)..v.. i%, c$,|
00000600  20 63 64 69 66 66 0d 02  80 17 63 64 69 66 66 20  | cdiff....cdiff |
00000610  3d 20 97 22 61 22 20 2d  20 97 22 41 22 0d 02 8a  |= ."a" - ."A"...|
00000620  12 e3 20 69 25 20 3d 20  31 20 b8 20 a9 61 24 0d  |.. i% = 1 . .a$.|
00000630  02 94 18 20 20 20 20 63  24 20 3d 20 c1 61 24 2c  |...    c$ = .a$,|
00000640  20 69 25 2c 20 31 29 0d  02 9e 21 20 20 20 20 e7  | i%, 1)...!    .|
00000650  20 63 24 20 3e 3d 20 22  41 22 20 80 20 63 24 20  | c$ >= "A" . c$ |
00000660  3c 3d 20 22 5a 22 20 8c  0d 02 a8 2a 20 20 20 20  |<= "Z" ....*    |
00000670  20 20 20 20 c1 61 24 2c  20 69 25 2c 20 31 29 20  |    .a$, i%, 1) |
00000680  3d 20 bd 28 97 28 63 24  29 20 2b 20 63 64 69 66  |= .(.(c$) + cdif|
00000690  66 29 0d 02 b2 09 20 20  20 20 cd 0d 02 bc 08 3d  |f)....    .....=|
000006a0  20 61 24 0d 02 c6 04 0d  02 d0 31 f4 20 65 78 69  | a$.......1. exi|
000006b0  74 20 66 72 6f 6d 20 68  65 72 65 2c 20 72 65 74  |t from here, ret|
000006c0  75 72 6e 69 6e 67 20 61  70 70 72 6f 70 72 69 61  |urning appropria|
000006d0  74 65 20 69 6e 66 6f 2e  0d 02 da 05 f4 0d 02 e4  |te info.........|
000006e0  11 dd f2 65 78 69 74 28  6e 25 2c 61 24 29 0d 02  |...exit(n%,a$)..|
000006f0  ee 25 ff 28 22 73 65 74  20 4e 65 77 73 42 61 73  |.%.("set NewsBas|
00000700  65 24 52 65 74 75 72 6e  43 6f 64 65 20 22 2b c3  |e$ReturnCode "+.|
00000710  6e 25 29 0d 02 f8 24 ff  28 22 73 65 74 20 4e 65  |n%)...$.("set Ne|
00000720  77 73 42 61 73 65 24 52  65 74 75 72 6e 49 6e 66  |wsBase$ReturnInf|
00000730  6f 20 22 2b 61 24 29 0d  03 02 05 e0 0d 03 0c 05  |o "+a$).........|
00000740  e1 0d 03 16 04 0d 03 20  11 dd a4 6f 62 6a 74 79  |....... ...objty|
00000750  70 65 28 66 24 29 0d 03  2a 07 ea 46 25 0d 03 34  |pe(f$)..*..F%..4|
00000760  1c c8 99 22 58 4f 53 5f  46 69 6c 65 22 2c 31 37  |..."XOS_File",17|
00000770  2c 66 24 b8 74 25 3b 46  25 0d 03 3e 14 e7 28 46  |,f$.t%;F%..>..(F|
00000780  25 80 31 29 8c 3d 2d 31  3a 8b 3d 74 25 0d ff     |%.1).=-1:.=t%..|
0000078f