home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1995 / ARCHIVE95.iso / discs / shareware / share_40 / star / !Star / !Help next >
Text File  |  1990-09-21  |  14KB  |  357 lines

  1.  
  2. STAR - A configurable iconbar menu system
  3.  
  4. VERSION 0.0 Mon,17 Sep 1990
  5.  
  6. INTRODUCTION
  7.   Star is a configurable wimp interface to non wimp programs such as
  8. operating system commands and other programs. Star peforms no useful
  9. functions itself, but allows files of additonal commands to be loaded. These
  10. commands appear as menu items on the star menu. Star can pass file names to
  11. the commands or programs.
  12.  
  13.  For example you can use star to
  14.  
  15.   Set the current directory
  16.   Set filetypes
  17.   Run the C compiler
  18.   Load a BASIC program into the BASIC editor
  19.   Translate BASIC to and from text
  20.   Print text files
  21.  
  22.   Star allows you to write simple programs to perform useful tasks, but
  23. still access them easily from the desktop.
  24.  
  25. RUNNING STAR
  26.   Star is a standard RISC_OS application, and is run by double clicking on
  27. its icon. Star needs version 3.5 or later of the shared C library and looks
  28. for this in the system:modules directory as usual.
  29.  The star icon then installs itself on the iconbar. Its only functions are
  30. to provide access to a menu tree, and to provide somewhere to drag files.
  31. When you drag files to the star icon it just remembers their names. The
  32. number of files that it has seen is recorded under the icon, a maximum of 16
  33. are allowed. The file names are remembered in order of arrival. If you drag
  34. a group of files their order may be unpredictable. The file names are
  35. forgotten after any menu selection. If you want to clear the files you have
  36. dragged you can click on the Info selection in the star submenu.
  37.  The only items on the menu tree that are provided by star itself come from
  38. the star submenu. They are :-  
  39.    
  40.                  Info     -    Info on star
  41.                  Load     -    Load the named files as star menu items.
  42.                  Unload   -    Remove previously loaded items
  43.                  Error    -    Display star's last error message.
  44.                  Quit     -    Quit star
  45.  
  46.   Star may also load one or more files of star menu items when it starts up.
  47. These are named as command line arguments. You can change the files that it
  48. loads at startup by editing star's !Run file.
  49.   Star has one more possible command line argument, a single minus sign,
  50. separated from the other arguments by spaces. If this is present the star
  51. icon installs on the right hand side of the iconbar. This is against RISC_OS
  52. practice, but leaves more room for menu selection. It must be the first
  53. argument in the list.
  54.  
  55. e.g. If the last line of !Run is 
  56.  
  57.    Run <Star$Dir>.!RunImage - <Star$Dir>.StarText.MyFile
  58.  
  59. Star will install on the right hand side, and load the file MyFile of menu
  60. items. 
  61.  
  62.   One of star's capabilities is to start up an editor and load a file into
  63. it. It does this by looking at the Alias$@RunType_FFF system variable,
  64. however if an editor is already loaded it is preferable to load the file
  65. directly into the editor rather than starting up a new copy. To do this star
  66. needs to know the name of your favorite editor as given in the task display
  67. window. I use my own wonderful editor Ed (Archive shareware disk 31), but
  68. you can use another RISC_OS editor such as Edit. You need only change the
  69. system variable Star$Ed to the desired name, by replacing the line in !Run
  70. with e.g. set Star$Ed Edit. Star will only recognise this editor if it was
  71. loaded after star.
  72.   Star needs a directory to hold temporary files, this is set in !Run to
  73. RAM:$ if you do not have some RAMFS configured you can change this.
  74.     E.g.
  75.                    Set Star$Scrap system:$
  76.  
  77. Note - any menu items outside the star subdirectory are loaded from star
  78. menu item files. The startup file provided is configured for my system, some
  79. items are unlikely to run on your system without alteration. To get the best
  80. out of star you will need to adjust some of the menu items, delete those you
  81. don't want and write some of your own. If you create a lot of menu items you
  82. may want to keep some in separate files and load them when needed.
  83.  
  84. STAR MENU ITEM FILES (Starfiles)
  85.  Starfiles have file type FFF (Text). They consist of a sequence of lines
  86. that are recognised by their first character (or their second if the first
  87. is a '|' ). Spaces ARE significant in star files, a line beginning with a
  88. space will be ignored.
  89.  
  90. A comment line is started with a semicolon. The rest of the line is ignored.
  91. In the explanations below I will put comments beside the line they refer to.
  92. You CANNOT do this in a real star file. Comments can only be whole lines.
  93.  
  94. A leaf menu item is named by a line starting by a colon. Immediately
  95. following the colon is the name that will appear on the menu. This name
  96. should not contain the five symbols ~>,!" . It should not be too long as
  97. this will make the menu wide. The lines that follow this line up to the next
  98. line starting with {} or : are the instructions that are executed when this
  99. menu item is selected.
  100.  
  101. e.g.
  102.  
  103. :RootDir    ;start a menu item called RootDir 
  104. *Dir $      ;this is what it does
  105.                                  
  106.  
  107. A submenu is named by a line starting with { followed immediately by the
  108. name that appears on the menu. Items in the submenu then appear as above
  109. until a line starting with } closes the submenu. Submenus can be nested. The
  110. same restrictions apply to submenu names as to item names.
  111.  
  112. e.g.
  113.  
  114. {Files      ;start a submenu called Files
  115. :Cat        ;first item in submenu
  116. *Cat
  117. {Dog        ;start a sub-submenu called Dog
  118. :Bark       ;first item in sub-submenu
  119.   .
  120.   .
  121. }
  122. :TopCat     ;Third item in submenu
  123. *Dir $
  124. }
  125.  
  126. Clicking on a submenu name has the same effect as clicking on the first item
  127. in the submenu. This can be a useful short cut, but you should be careful
  128. which items you chose for the top of submenus. Normally star files to be
  129. loaded should only have a small number of entries in the root level menu, to
  130. avoid this becoming overcrowded. 
  131.  
  132. Most of the remaining line types have string arguments. All these arguments
  133. may be substituted and can be translated.
  134.  Sustitution replaces a percent sign and some following characters by a new
  135. string as follows
  136.  
  137.      %%         %
  138.      %0 ... %9  1st filename ... tenth filename
  139.      %!         All the filenames followed by spaces
  140.      %?         nth filename (see below)
  141.      %"string"  star prompts for input displaying string
  142.                 the input string is the replacement
  143. E.g.
  144.  
  145. *Filer_Opendir %1       ;Opens the second filename given ( it had better have                         been a directory)
  146.  
  147. *emacs  %!              ;loads the emacs editor and loads all the files named
  148.  
  149. The filenames used in substitution may be modified by < and > signs inserted
  150. between the % and 0..9,? or ! . > takes the leafname and < the directory.
  151.  
  152. e.g. If the first file is $.a.b.c
  153.  
  154.      %>0   gives  c
  155.      %<0   gives  $.a.b
  156.      %<<0  gives  $.a
  157.      %<>0  gives  b
  158.      %>>0  fails
  159.  
  160. A %0..%9 or %? operation will fail if the requested filename was not given.
  161. When star fails a line the rest of lines are abandoned. The iconbar text is
  162. set to !? and an error message is placed in the system variable Star$Error.
  163. You can inspect this from the Error item in the star submenu.
  164.  
  165.  
  166.  Translated lines are preceeded by 
  167.              |     . . .    GS_trans the argument
  168.              !     . . .    GS_trans <>'s only.
  169.  GS_trans replaces |M by the <ctrl>M character, <name> by the system
  170. variable name, <99> by character 99 etc. GS_trans is performed after
  171. substitution.
  172.  
  173. e.g.
  174.  
  175. *Filer_Opendir <Star$Dir>         ;Would fail
  176.  
  177. |*Filer_Opendir <Star$Dir>        ;Opens the star application directory. 
  178.  
  179. Note many star commands perform their own GS_Trans.
  180.  
  181. e.g.
  182.  
  183. *Echo "|GHello world|M"   ;beeps and prints out
  184.  
  185. |*Echo "|GHello world|M"   ;fails due to unknown characters in string
  186.  
  187. A line starting with ( starts a repeat block. The repeated commands are run
  188. once for each file name given. The repeat ends at a line starting with ).
  189. The repeat can be started at the nth file by following the ( immediately by
  190. 0-9. (0 is the same as (. The file name in the repeat is given by %? .
  191.  
  192. e.g.
  193.  
  194. (1         ;give information on all files except the first. 
  195. *info %?
  196. )
  197.  
  198. () may not be nested.
  199.  
  200. A line begining with * sends its argument to the command line interpreter.
  201. This is performed using wimp_starttask. If the command outputs to the screen
  202. a wimp command window will be opened on the screen and you will have to
  203. press a key or click the mouse before continuing.
  204.  
  205. A line starting with [ introduces a block that ends with a line starting
  206. with ]. In between these lines may only start with * or with a matched pair
  207. of (). [] may not be nested. The commands in a [] block are saved to a
  208. temporary obey file. After the ] the file is obeyed. Any string following
  209. the ] is added to the obey instrution.
  210.   There are several differences between obeying commands individually and as
  211. a file. If the individual commands produce screen output you will have to
  212. close the command window after each command, whereas the file of commands
  213. will all write to the same window. If a command in a file produces a RISC_OS
  214. error (rather than a star error) the rest of the file will be abandoned,
  215. whereas individual commands will only abandon that command.
  216.  
  217. E.g.
  218.  
  219. [          ;put information on all files into one command window.
  220. (
  221. *info %?
  222. )
  223. ]
  224.  
  225. [
  226. *dir $
  227. *cat
  228. ] { > printer: }  redirect two commands to the printer.
  229.  
  230. A line starting with < gives a default file name, the < should be followed
  231. immediately by a file number 0..9.
  232.  
  233. E.g
  234.  
  235. :SetDir
  236. <0 $    ;If no files have been dragged set name 0 to $
  237. *Dir %0
  238.  
  239. A line starting with # gives a set of acceptable filetypes for a file  The #
  240. should be followed immediately by 0..9 ? or ! . The possible filetypes in
  241. hex follow separated by spaces. Application directories have type 2000,
  242. other directories have type 1000. Defaults provided by < lines have type
  243. 123456. If the filetype is not among those given the remaining commands are
  244. abandoned.
  245.  
  246. E.g.
  247.  
  248. :SetDir 
  249. <0 $
  250. #0 1000 2000 123456   ;Check if file is a directory
  251. *Dir %0
  252.  
  253. A line starting with ? queries the user. The rest of the command line is
  254. used as a prompt. If the user responds <cancel> the remaining commands are
  255. abandoned.
  256.  
  257. E.g.
  258.  
  259. :Wipe
  260. #0 1000 2000
  261. *Filer_opendir %0
  262. ?Do you really want to wipe this directory?  ;Ask user
  263. *Wipe ~C~VFR  %0.*
  264.  
  265. Lines starting with > open an editor and pass the rest of the command to it.
  266. If the editor Star$Ed has been seen star sends it a DATALOAD message with
  267. the rest of the command as file, otherwise it runs the rest of the command.
  268.  
  269. E.g.
  270.  
  271. > RAM:temp  ;load RAM:temp into an editor
  272.  
  273. Lines starting with + insert the rest of the line into the keyboard buffer.
  274. For this to be of any use you need to know where the keypresses will be
  275. sent. This shold be ok if you have just opened a file using > ,or you are
  276. about to run a non-wimp application.
  277.  
  278. E.g.
  279.  
  280. :Goto 5
  281. > %0        ;open file
  282. |+<&85>5|M  ;put <F5> 5 <Return> into buffer
  283.             ;If you are using Edit this goes to line 5
  284.             ;Note GS_Trans is needed
  285.  
  286. :LoadProg #0 FFB         ;check basic filetype
  287. |+LOAD "%0"|M
  288. BASIC                    ;Load program into BASIC
  289.  
  290. KNOWN SHORTCOMINGS
  291.  
  292.   Star's error messages are a bit crypic. Although some checking of star
  293. file syntax is done on loading they are supposed to be correct. It may be
  294. difficult to distinguish between a bug in star, a bug in your star file, or
  295. a RISC_OS error.
  296.   It was difficult to know when to stop adding star commands. Star could be
  297. given if-then-else and for loops etc. However if you need these it is
  298. probably better to write a small Basic or C program and run it from star,
  299. rather than use what is a rather awkward interpreted language. Also star has
  300. already become rather larger than I would like it, although this is largely
  301. due to the size of RISC_OSlib. I hope Acorn will get round to putting
  302. RISC_OSlib in a shared module, preferably in ROM.
  303.  
  304. COMMAND SUMMARY
  305.  
  306.      First symbol  Qualifiers    Tail       Use
  307.           :                      Name     Start menu item
  308.           {                      Name     Start submenu
  309.           }                               End submenu
  310.           ;                      String   Comment
  311.           (         0-9 or none           Repeat for each file after n
  312.           )                               End repeat
  313.           [                               Start Obey file
  314.           ]                      String   End Obey file
  315.           *                      String   Star command
  316.           <         0-9          String   Default file name
  317.           >                      String   Edit
  318.           +                      String   Insert in keybord buffer
  319.           ?                      String   Query with string prompt
  320.           #         0-9 ? !      String   Check filetypes
  321.  
  322.   In string tails %Qualifier is substituted as follows
  323.      Qualifier    Substitution
  324.          0-9       Filename 0-9
  325.           !        All filenames followed by spaces
  326.           ?        Filename for repeat loop number
  327.           "string" Prompt for input with string prompt
  328.           %        %
  329.  
  330. Between the % and !?0-9 may go any number of < or >  characters
  331.           <        Tail of filename
  332.           >        Leafname        
  333.           
  334.   The first symbols with string arguments may be preceeded by
  335.           |         GStrans after substitution
  336.           !         GStrans <>'s only after substitution
  337.  
  338.   Filetype strings contain a list of permissible hex filetypes separated by
  339. spaces 1000 for directory, 2000 for application dir ,FFFFFFFF for untyped,
  340. 123456 for a < default substitution. 
  341.  
  342.   Names may not contain the symbols ,~>!"
  343.  
  344. Inside [ ]  pairs the only permissible first characters are * ( ) . () must
  345. both be inside. Neither () nor [] can be nested.
  346.  
  347.  
  348. COMMENTS PLEASE
  349.  
  350.                  I would welcome bug reports, criticism (constructive or
  351. otherwise), modifications or suggestions for modifications.
  352.  
  353.                   Chris Stretch
  354.                                  Archive BBS No.62
  355.                          CBTP13@JANET%UK.AC.ULSTER.UCVAX
  356.  
  357.