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

Director/!Director/Menus/Internal/Enumerate

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/Internal/Enumerate
Read OK:
File size: 0472 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
    1REM >Director:Menus.Enumerate
    2ON ERROR ERROR EXT ERR,REPORT$+" at line "+STR$ERL:END
    3SYS "OS_GetEnv" TO in$
    4type%=VAL(FNarg(in$,"-type","0"))
    5CASE type% OF
    6  WHEN 0: name$="Menus": action$=" -sub Dynamic:/Director:Menus.Internal.MenusSub"
    7  WHEN 1: name$="Displayed": action$=""
    8  WHEN 2: name$="Icons": action$=" -sub Dynamic:/Director:Menus.Internal.IconsSub"
    9  WHEN 3: name$="Filters": action$=" -sub Dynamic:/Director:Menus.Internal.FiltersSub"
   10  OTHERWISE: ERROR 1,"Unknown type"
   11ENDCASE
   12
   13menu=FNswi_number("Director_Menu")
   14endmenu=FNswi_number("Director_EndMenu")
   15option=FNswi_number("Director_Option")
   16command=FNswi_number("Director_Command")
   17dash=FNswi_number("Director_Dash")
   18enumerate=FNswi_number("Director_Enumerate")
   19
   20*Set Director$Menu Enumerate
   21SYS menu,name$+" <Director$Menu> -temp"
   22p%=type%
   23REPEAT
   24  SYS enumerate,p% TO p%,name$
   25  IF p% THEN
   26    SYS option,""""+name$+""""+action$
   27  ENDIF
   28UNTIL p%=0
   29SYS endmenu
   30END
   31
   32DEF FNarg(str$,arg$,def$)
   33LOCAL i,j
   34i=INSTR(str$,arg$)
   35IF i=0 THEN =def$
   36i+=LENarg$+1
   37j=INSTR(str$+" <"," ",i)
   38=MID$(str$,i,j-i)
   39
   40DEF FNswi_number(swi$)
   41SYS "OS_SWINumberFromString",,swi$ TO swi%
   42=swi%
� >Director:Menus.Enumerate
!� � � � �,�$+" at line "+Þ:�
ș "OS_GetEnv" � in$
"type%=�(�arg(in$,"-type","0"))
Ȏ type% �
S  � 0: name$="Menus": action$=" -sub Dynamic:/Director:Menus.Internal.MenusSub"
(  � 1: name$="Displayed": action$=""
S  � 2: name$="Icons": action$=" -sub Dynamic:/Director:Menus.Internal.IconsSub"
	W  � 3: name$="Filters": action$=" -sub Dynamic:/Director:Menus.Internal.FiltersSub"

  : � 1,"Unknown type"
�


%menu=�swi_number("Director_Menu")
+endmenu=�swi_number("Director_EndMenu")
)option=�swi_number("Director_Option")
+command=�swi_number("Director_Command")
%dash=�swi_number("Director_Dash")
/enumerate=�swi_number("Director_Enumerate")

 *Set Director$Menu Enumerate
*ș menu,name$+" <Director$Menu> -temp"
p%=type%
�
   ș enumerate,p% � p%,name$
  � p% �
)    ș option,""""+name$+""""+action$
  �

� p%=0
ș endmenu
�

 � �arg(str$,arg$,def$)
!	� i,j
"i=�str$,arg$)
#� i=0 � =def$
$i+=�arg$+1
%j=�str$+" <"," ",i)
&=�str$,i,j-i)
'
(� �swi_number(swi$)
),ș "OS_SWINumberFromString",,swi$ � swi%
*	=swi%
�
00000000  0d 00 01 1f f4 20 3e 44  69 72 65 63 74 6f 72 3a  |..... >Director:|
00000010  4d 65 6e 75 73 2e 45 6e  75 6d 65 72 61 74 65 0d  |Menus.Enumerate.|
00000020  00 02 21 ee 20 85 20 85  20 a2 20 9f 2c f6 24 2b  |..!. . . . .,.$+|
00000030  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 9e 3a e0  |" at line "+..:.|
00000040  0d 00 03 18 c8 99 20 22  4f 53 5f 47 65 74 45 6e  |...... "OS_GetEn|
00000050  76 22 20 b8 20 69 6e 24  0d 00 04 22 74 79 70 65  |v" . in$..."type|
00000060  25 3d bb 28 a4 61 72 67  28 69 6e 24 2c 22 2d 74  |%=.(.arg(in$,"-t|
00000070  79 70 65 22 2c 22 30 22  29 29 0d 00 05 0e c8 8e  |ype","0"))......|
00000080  20 74 79 70 65 25 20 ca  0d 00 06 53 20 20 c9 20  | type% ....S  . |
00000090  30 3a 20 6e 61 6d 65 24  3d 22 4d 65 6e 75 73 22  |0: name$="Menus"|
000000a0  3a 20 61 63 74 69 6f 6e  24 3d 22 20 2d 73 75 62  |: action$=" -sub|
000000b0  20 44 79 6e 61 6d 69 63  3a 2f 44 69 72 65 63 74  | Dynamic:/Direct|
000000c0  6f 72 3a 4d 65 6e 75 73  2e 49 6e 74 65 72 6e 61  |or:Menus.Interna|
000000d0  6c 2e 4d 65 6e 75 73 53  75 62 22 0d 00 07 28 20  |l.MenusSub"...( |
000000e0  20 c9 20 31 3a 20 6e 61  6d 65 24 3d 22 44 69 73  | . 1: name$="Dis|
000000f0  70 6c 61 79 65 64 22 3a  20 61 63 74 69 6f 6e 24  |played": action$|
00000100  3d 22 22 0d 00 08 53 20  20 c9 20 32 3a 20 6e 61  |=""...S  . 2: na|
00000110  6d 65 24 3d 22 49 63 6f  6e 73 22 3a 20 61 63 74  |me$="Icons": act|
00000120  69 6f 6e 24 3d 22 20 2d  73 75 62 20 44 79 6e 61  |ion$=" -sub Dyna|
00000130  6d 69 63 3a 2f 44 69 72  65 63 74 6f 72 3a 4d 65  |mic:/Director:Me|
00000140  6e 75 73 2e 49 6e 74 65  72 6e 61 6c 2e 49 63 6f  |nus.Internal.Ico|
00000150  6e 73 53 75 62 22 0d 00  09 57 20 20 c9 20 33 3a  |nsSub"...W  . 3:|
00000160  20 6e 61 6d 65 24 3d 22  46 69 6c 74 65 72 73 22  | name$="Filters"|
00000170  3a 20 61 63 74 69 6f 6e  24 3d 22 20 2d 73 75 62  |: action$=" -sub|
00000180  20 44 79 6e 61 6d 69 63  3a 2f 44 69 72 65 63 74  | Dynamic:/Direct|
00000190  6f 72 3a 4d 65 6e 75 73  2e 49 6e 74 65 72 6e 61  |or:Menus.Interna|
000001a0  6c 2e 46 69 6c 74 65 72  73 53 75 62 22 0d 00 0a  |l.FiltersSub"...|
000001b0  1b 20 20 7f 3a 20 85 20  31 2c 22 55 6e 6b 6e 6f  |.  .: . 1,"Unkno|
000001c0  77 6e 20 74 79 70 65 22  0d 00 0b 05 cb 0d 00 0c  |wn type"........|
000001d0  04 0d 00 0d 25 6d 65 6e  75 3d a4 73 77 69 5f 6e  |....%menu=.swi_n|
000001e0  75 6d 62 65 72 28 22 44  69 72 65 63 74 6f 72 5f  |umber("Director_|
000001f0  4d 65 6e 75 22 29 0d 00  0e 2b 65 6e 64 6d 65 6e  |Menu")...+endmen|
00000200  75 3d a4 73 77 69 5f 6e  75 6d 62 65 72 28 22 44  |u=.swi_number("D|
00000210  69 72 65 63 74 6f 72 5f  45 6e 64 4d 65 6e 75 22  |irector_EndMenu"|
00000220  29 0d 00 0f 29 6f 70 74  69 6f 6e 3d a4 73 77 69  |)...)option=.swi|
00000230  5f 6e 75 6d 62 65 72 28  22 44 69 72 65 63 74 6f  |_number("Directo|
00000240  72 5f 4f 70 74 69 6f 6e  22 29 0d 00 10 2b 63 6f  |r_Option")...+co|
00000250  6d 6d 61 6e 64 3d a4 73  77 69 5f 6e 75 6d 62 65  |mmand=.swi_numbe|
00000260  72 28 22 44 69 72 65 63  74 6f 72 5f 43 6f 6d 6d  |r("Director_Comm|
00000270  61 6e 64 22 29 0d 00 11  25 64 61 73 68 3d a4 73  |and")...%dash=.s|
00000280  77 69 5f 6e 75 6d 62 65  72 28 22 44 69 72 65 63  |wi_number("Direc|
00000290  74 6f 72 5f 44 61 73 68  22 29 0d 00 12 2f 65 6e  |tor_Dash").../en|
000002a0  75 6d 65 72 61 74 65 3d  a4 73 77 69 5f 6e 75 6d  |umerate=.swi_num|
000002b0  62 65 72 28 22 44 69 72  65 63 74 6f 72 5f 45 6e  |ber("Director_En|
000002c0  75 6d 65 72 61 74 65 22  29 0d 00 13 04 0d 00 14  |umerate").......|
000002d0  20 2a 53 65 74 20 44 69  72 65 63 74 6f 72 24 4d  | *Set Director$M|
000002e0  65 6e 75 20 45 6e 75 6d  65 72 61 74 65 0d 00 15  |enu Enumerate...|
000002f0  2a c8 99 20 6d 65 6e 75  2c 6e 61 6d 65 24 2b 22  |*.. menu,name$+"|
00000300  20 3c 44 69 72 65 63 74  6f 72 24 4d 65 6e 75 3e  | <Director$Menu>|
00000310  20 2d 74 65 6d 70 22 0d  00 16 0c 70 25 3d 74 79  | -temp"....p%=ty|
00000320  70 65 25 0d 00 17 05 f5  0d 00 18 20 20 20 c8 99  |pe%........   ..|
00000330  20 65 6e 75 6d 65 72 61  74 65 2c 70 25 20 b8 20  | enumerate,p% . |
00000340  70 25 2c 6e 61 6d 65 24  0d 00 19 0c 20 20 e7 20  |p%,name$....  . |
00000350  70 25 20 8c 0d 00 1a 29  20 20 20 20 c8 99 20 6f  |p% ....)    .. o|
00000360  70 74 69 6f 6e 2c 22 22  22 22 2b 6e 61 6d 65 24  |ption,""""+name$|
00000370  2b 22 22 22 22 2b 61 63  74 69 6f 6e 24 0d 00 1b  |+""""+action$...|
00000380  07 20 20 cd 0d 00 1c 0a  fd 20 70 25 3d 30 0d 00  |.  ...... p%=0..|
00000390  1d 0e c8 99 20 65 6e 64  6d 65 6e 75 0d 00 1e 05  |.... endmenu....|
000003a0  e0 0d 00 1f 04 0d 00 20  1a dd 20 a4 61 72 67 28  |....... .. .arg(|
000003b0  73 74 72 24 2c 61 72 67  24 2c 64 65 66 24 29 0d  |str$,arg$,def$).|
000003c0  00 21 09 ea 20 69 2c 6a  0d 00 22 11 69 3d a7 73  |.!.. i,j..".i=.s|
000003d0  74 72 24 2c 61 72 67 24  29 0d 00 23 11 e7 20 69  |tr$,arg$)..#.. i|
000003e0  3d 30 20 8c 20 3d 64 65  66 24 0d 00 24 0e 69 2b  |=0 . =def$..$.i+|
000003f0  3d a9 61 72 67 24 2b 31  0d 00 25 17 6a 3d a7 73  |=.arg$+1..%.j=.s|
00000400  74 72 24 2b 22 20 3c 22  2c 22 20 22 2c 69 29 0d  |tr$+" <"," ",i).|
00000410  00 26 11 3d c1 73 74 72  24 2c 69 2c 6a 2d 69 29  |.&.=.str$,i,j-i)|
00000420  0d 00 27 04 0d 00 28 17  dd 20 a4 73 77 69 5f 6e  |..'...(.. .swi_n|
00000430  75 6d 62 65 72 28 73 77  69 24 29 0d 00 29 2c c8  |umber(swi$)..),.|
00000440  99 20 22 4f 53 5f 53 57  49 4e 75 6d 62 65 72 46  |. "OS_SWINumberF|
00000450  72 6f 6d 53 74 72 69 6e  67 22 2c 2c 73 77 69 24  |romString",,swi$|
00000460  20 b8 20 73 77 69 25 0d  00 2a 09 3d 73 77 69 25  | . swi%..*.=swi%|
00000470  0d ff                                             |..|
00000472