home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / c / xicon.1.doc < prev    next >
Text File  |  1987-04-11  |  10KB  |  229 lines

  1.                                                                9 August 1986
  2.      XICON  --   Execute Command File from an Icon
  3.  
  4.      TICON  --   Type Text File from an Icon
  5.  
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7.  
  8.       Copyright (c) 1986 by Pete Goodeve -- All Rights Reserved
  9.  
  10.    Permission is granted to distribute or modify these programs freely,
  11.    provided that no charge is made for their use, and that this notice
  12.    accompanies them.  For any commercial purposes, please contact the
  13.    author:
  14.                   Pete Goodeve
  15.                   3012 Deakin Street #D
  16.                   Berkeley, Calif. 94705
  17.  
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19.  
  20.  
  21.  
  22.     *********
  23.       XICON
  24.     *********
  25.  
  26.       With this program you can execute a file of AmigaDOS CLI commands
  27. directly from a WorkBench window, rather than from the CLI, simply by
  28. double-clicking an associated icon in the window.  A full-screen window
  29. will be opened to display the output of the commands.  To close the
  30. window again type a control-C (or control-D) -- or it can be configured to
  31. close automatically by setting the ToolType 'MODE=closewindow' in the
  32. icon.
  33.  
  34. You also have the option of executing commands from the ToolTypes lines
  35. of the icon itself, if you specify them with the 'CMD=...' ToolType.
  36. (There are advantages and disadvantages to this.)
  37.  
  38. The icon you click on must always have a file associated with it in order
  39. to keep WorkBench happy, but this needn't NECESSARILY be a list of CLI
  40. commands; if you set 'MODE=noscript' it can be any type of data; you can
  41. operate on it if you want with commands in the ToolTypes list.
  42.  
  43. You can select more than one icon at a time if you like, by holding down
  44. the Shift key as you click on each.  Only DOUBLE-click on the LAST selection
  45. (or use the "Open" item in the WorkBench Menu -- see "Introduction to
  46. Amiga").
  47.  
  48.  
  49.  
  50. Setup:   You can install Xicon itself in any convenient directory: the
  51.          best is probably either the 'C:' directory of your Workbench disk
  52. or its root directory  ('SYS:').  (It doesn't need an icon of its own.)
  53. Whichever directory you use, the icons that are going to invoke it must
  54. have a matching pathname as their DEFAULT TOOL (see below).
  55.  
  56. You can put an icon and its associated file in any directory ("drawer")
  57. that you can open under WorkBench.  The file must of course have the same
  58. name as the icon (without the '.info' extension the icon has tacked on).
  59. Each icon must be of type 'PROJECT' with a DEFAULT TOOL string specifying
  60. a path to the Xicon program.  If it is in the same directory, 'xicon' will
  61. suffice, otherwise you must use the complete pathname.
  62.  
  63.  
  64.  
  65. Command Scripts:  There are many ways to generate Command Script files
  66.                   with their icons.  One simple approach is to duplicate
  67. the "democommand" supplied and rename it (using WorkBench Menu operations),
  68. then go to the CLI and modify the text file using whatever editor you are
  69. comfortable with.  If xicon is not in the local directory, you will also
  70. have to change the Default Tool in the icon to the correct pathname.
  71.  
  72. Alternatively you can create the text file first (let's call it 'myscript'),
  73. then use the CLI to copy a suitable project icon ('democommand.info' for
  74. instance) to 'myscript.info' and modify it as necessary.
  75.  
  76.  
  77.  
  78. Modifying an icon:   All the changes you should need to make to an icon
  79.                      can be done with the 'Info' item in the WorkBench
  80. Menu.  Select the icon you want to modify by clicking on it, depress the
  81. right mouse button to bring up the menu, and select 'Info' from the
  82. 'WorkBench' section.  This should bring up an information window for
  83. that icon.
  84.  
  85. To set the DEFAULT TOOL, click in that gadget and type in (or edit) the
  86. string.
  87.  
  88. To enter a new TOOL TYPE, click first on the ADD gadget, then click in the
  89. string gadget and type it in.  If you want to insert it into an existing
  90. set, use the arrow gadgets on the left to move to the desired point first.
  91. You can of course edit the strings in the usual way.  Use the DEL gadget
  92. to remove a line completely.
  93.  
  94. When you are done, click in the SAVE box to preserve the changes.
  95.  
  96.  
  97.  
  98. MODE Setting:     You can alter the assumptions made by Xicon by setting the
  99.                   Tool Type 'MODE'.
  100.  
  101.       'MODE=closewindow' avoids having to type control-C to terminate
  102.       the program.  The window will close as soon as all the commands
  103.       have completed.
  104.  
  105.       'MODE=noscript' prevents Xicon from trying to read commands from
  106.       its associated file, so this can be of any type.  This option only
  107.       makes sense if the 'CMD=' Tool Type is used to supply the commands.
  108.  
  109. Only one MODE entry will be recognized in the Tool Types array, so if you
  110. want both the above options, specify 'MODE=noscript|closewindow'.
  111.  
  112.  
  113. Commands in the Icon:   Instead of a script file, you can specify commands
  114.                         directly in the Tool Types array of the icon, with
  115. the 'CMD=command string' format.  (For example: 'CMD=list df1:work'.)
  116.  
  117. Include as many of these as you like.  They will be executed in sequence,
  118. but each by a separate CLI process, so you can't use a command to set
  119. parameters like stack size or current directory for the ones that follow.
  120. A Command Script file on the other hand is executed completely by one
  121. process, so settings are inherited.
  122.  
  123.  
  124.  
  125. Caveats:
  126.  
  127.    There is no provision at the moment for changing the size of the display
  128.    window -- it is always full-screen.  A later version may allow you to
  129.    specify this via the TOOLTYPES strings in the icon.
  130.  
  131.    The most annoying defect is that the "Execute()" system call used by
  132.    xicon loses track of the current directory when invoked by a WorkBench
  133.    program (it switches to DF0:).  I've tried a lot of tricks to correct
  134.    this, without success, so -- if you want to list the directory or
  135.    something -- I'm afraid you always have to specify a FULL pathname
  136.    somewhere in the command script.  Sorry.  If you have several commands
  137.    in your script, make a suitable 'CD mydisk:mydir' your first command.
  138.  
  139.    The "Execute" referred to above is NOT the DOS "EXECUTE" Command, by the
  140.    way, in case anyone is confused.  Actually it requires the DOS "RUN"
  141.    command -- which must be available in the "C:" directory -- for its
  142.    operation.  (Now I'll bet you're confused again...)
  143.  
  144.    Because xicon's method of calling Execute() sets up the command
  145.    file as the input stream, the output window cannot be used as a
  146.    console.  So if a command needs keyboard input it must open up its own
  147.    console window using I/O redirection, e.g.:
  148.  
  149.                mycommand <CON:0/100/150/50/input
  150.  
  151.    (It would likely be a program of your own, because DOS commands don't
  152.    usually ask for input, unless you use the "?" option in the command
  153.    line.  Although, for an example, see the "Set Date" command file in this
  154.    directory.)  You might also want to try "EXECUTE CON:0/100/150/50/exec"
  155.    --or whatever you have renamed that command as.  (To get out of the
  156.    mini-CLI you just created, use 'control-\'.)
  157.  
  158.    The initial stack size is always 4000 bytes.  You can change this in
  159.    your command script with a sutitable STACK command.  Note that the
  160.    STACK gadget in the icon Info window does not have any effect.  (Except
  161.    on the stack used by Xicon itself!  I haven't investigated how much
  162.    it needs.)
  163.  
  164.    You cannot interrupt a command sequence with control-C or control-D
  165.    (because the input stream has been diverted), although output can be
  166.    paused with the space bar in the usual way.  Be careful not to write
  167.    a command file that can get "stuck", or you will never be able to
  168.    close that window.  
  169.  
  170.    Unfortunately DOS won't let you use IF, SKIP, QUIT, and so on in
  171.    these command files, and of course argument expansion is not available.
  172.  
  173.    I really SHOULD have supplied some kind of close gadget for the window,
  174.    rather than requiring the user to type control-C, but locating a
  175.    window opened as a DOS Console is a pain, so maybe another time...
  176.  
  177.                            %%%%%%%%%%%%%%%%
  178.  
  179.  
  180.  
  181.  
  182.  
  183.     *********
  184.       TICON
  185.     *********
  186.  
  187.       This program allows the user to display a text file by double-clicking
  188. on an associated icon.  You are probably reading this file under its
  189. management.  The pause at the end of each screenful is automatic.
  190.  
  191.  
  192. Setup:   Essentially identical to the procedures for Xicon above, except
  193.          that the file is displayed rather than executed, and the
  194. DEFAULT TOOL is "TICON".  Any simple text file may be used, provided it is
  195. sensibly formatted (with newlines in the right places).
  196.  
  197.  
  198. Restrictions:  This is just a crude and simple text reading program.  You
  199.                can't backtrack or skip forward.  You can, however, abort
  200. at any point with control-C.  (If it is waiting for a return, you will have
  201. to type this after the control-C.  The window won't close until you type a
  202. second control-C.)
  203.  
  204. There are no Tool Type options.
  205.  
  206.                            %%%%%%%%%%%%%%%%
  207.  
  208.  
  209. Coda
  210.  
  211. I hope you find these programs useful.  If you do, please pass them around
  212. freely.  I suggest you copy the entire drawer -- with its demo and source
  213. files -- by dragging its icon to another disk.  (You won't see either the
  214. programs or their sources in the WorkBench window; they don't have icons.
  215. You can only get at them using the CLI.)
  216.  
  217. I'll welcome any feedback you wish to give.  My address is at the top.
  218. Watch for some Shareware following not too far behind in this same pipe...
  219. Over the last few months I have been developing an enhanced CLI system.
  220. Unlike Xicon -- and all the other similar developments that I know of --
  221. it does NOT use the Execute() call; instead, it handles all its own
  222. facilities and provides total upward compatibility with the standard CLI.
  223. Even at its present stage it is installed as my standard user interface.
  224. (I'll leave you in suspense as to the extra features it will have for now.
  225. When it is released you can check them out for yourself...)
  226.  
  227.                           ##############
  228.  
  229.