home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff290.lzh / Xicon / README < prev    next >
Text File  |  1989-12-11  |  9KB  |  199 lines

  1.  
  2.  
  3.                              -- Xicon 2.5 --
  4.  
  5.                               December 1989
  6.  
  7.  
  8. It's been more than three years since I originally wrote Xicon (July 1986),
  9. and until last year it was essentially the only program to provide a means
  10. of running a CLI command script from an icon.  With Commodore's own IconX,
  11. it finally has some competition.  The previous version of Xicon -- 2.01 --
  12. has a number of features that are missing from IconX, but, equally well,
  13. IconX has a couple of very useful options that I had always wanted in Xicon
  14. but never could figure out a neat way to do.  Spurred on by the example
  15. placed in front of me, I finally got my act together and put the missing
  16. features in.  Xicon 2.5 does everything IconX does, and still has all its
  17. old features (including one or two -- like LOCDIR -- that are a bit
  18. redundant now).
  19.  
  20. For many straightforward applications IconX can now supplant Xicon, but
  21. I think Xicon is still a worthwhile alternative -- despite being twice
  22. the size of IconX -- because it has some tricks of its own that aren't
  23. available otherwise.  In particular, there is its unique ability to have
  24. the icon attached NOT to a script file directly but to another type of
  25. object, say a directory that contains -- as well as the script -- a whole
  26. package of files.  In this case the script is referenced by a ToolType
  27. entry in the icon itself.  Alternatively, the script to be executed could
  28. be in some other drawer entirely; or you could run several scripts in
  29. different drawers from one icon.  (Under WorkBench 1.3, in fact, you now
  30. don't need anything at ALL attached to the icon, so you can control
  31. everything with ToolTypes if you want.)
  32.  
  33. Then there is the (somewhat rudimentary, I concede...) facility for
  34. displaying a text file directly, or even displaying some text directly from
  35. the icon file itself. Xicon gives you a Close gadget to exit rather than a
  36. predetermined delay, and you can take differing actions depending on
  37. whether the user has aborted the sequence or not.  Not only can you control
  38. the size of the window, but you can change its title; you can even dispense
  39. with a window altogether if the script isn't going to generate any useful
  40. output.
  41.  
  42.  
  43.                         Drawer Contents
  44.                         ===============
  45.  
  46. This package is considerably streamlined from previous releases.  I haven't
  47. even included sources this time (though if you really want them I'm sure it
  48. can be arranged...).  The only examples I've included are the three icons
  49. you see -- Xicon itself and the two texts.  You might want to look at the
  50. ToolTypes of these to see how an icon/file pair can be made to do several
  51. things, even without any "script" at all.
  52.  
  53. The Xicon one, for example, in addition to displaying information -- if
  54. available --, now gives you the option of installing Xicon in your C:
  55. directory.  You will see also that it checks to see if the informational
  56. text is available, and if not just displays a brief apology and proceeds.
  57.  
  58.  
  59.  
  60.                         Manual Update
  61.                         =============
  62.  
  63. The accompanying manual has been revised to match the new features, but
  64. for those already familiar with the program, I'm including a summary of
  65. the new stuff here.
  66.  
  67. [++ By the way, to avoid confusion, when I refer (above and below) to the
  68. script or other file "attached" to the icon, I mean the file in the same
  69. directory that has the same name as the icon sans ".info". ++]
  70.  
  71.  
  72.  
  73. * Current Directory setting:
  74.  
  75. The most important new feature is that the "current directory" is now set
  76. to that containing the icon clicked on, before the script (either in the
  77. same directory or elsewhere) is executed.  This eliminates the need for
  78. the LOCDIR ToolType hack, although it is left in this version so that
  79. scripts expecting it don't break.
  80.  
  81. The current directory is set before each script (if there is more than one).
  82. It is also set before executing any command line specified directly in a
  83. "CMD=..." ToolType.
  84.  
  85.  
  86.  
  87. * Scripts with Conditional Commands and Parameters:
  88.  
  89. It is now possible to invoke scripts that contain conditional DOS commands
  90. (IF, ELSE, etc).  To do this, Xicon needs to have the EXECUTE command
  91. available in the C: directory (as well as the RUN command, which it has
  92. always needed).  The FIRST character of a script that contains conditional
  93. commands (at least if it is directly attached to the icon), must be a
  94. period ".".  This may be the first character of a ".KEY..." script directive
  95. (see below) or sometimes you can simply use a period by itself on the line.
  96.  
  97. If you intend to use EXECUTE, and don't actually have any .KEY parameters,
  98. it will probably still save you a lot of grief to simply use a dummy
  99. directive of the form:
  100.                         .K ""
  101.  
  102. where the "" supplies a null parameter that EXECUTE will ignore.  Otherwise
  103. a "<" character occurring ANYWHERE in your script (even in a comment!) will
  104. cause EXECUTE to complain "No .K directive".  [Just one more of the Amazing
  105. features of DOS...]
  106.  
  107. If the first character of an attached script is NOT a period, Xicon runs
  108. the sequence of commands directly, just as it always has.
  109.  
  110. You can also invoke EXECUTE on any script through a ToolType entry:
  111.  
  112.         EXECUTE=scriptname arg1 arg2....
  113.  
  114. where 'scriptname' is the script file you wish to run (given as a full
  115. pathname if it is not in the same directory as the icon), and 'arg1' etc
  116. are optional arguments (parameters) to pass to the script -- if it has
  117. a suitable '.KEY' directive to accept them (see your DOS manual under
  118. 'EXECUTE').
  119.  
  120. The "EXECUTE=..." ToolType is in addition to the old "SCRIPT=..." one, which
  121. operates as it always has -- i.e. it NEVER uses EXECUTE (even if the script
  122. begins with a period).  On the other hand, "EXECUTE=..." doesn't require
  123. that initial period, so you can run Shell scripts (that might have
  124. conditional commands but no .KEY directive, perhaps) without changing them.
  125. In parallel to the "ABORT-SCRIPT=..." ToolType there is "ABORT-EXECUTE...".
  126. [As an aside for the adventurous, there is no reason why a "script"
  127. referenced by a ToolType could not in fact be a Pipe, filled by previous
  128. actions!  Maybe you can think of an application...]
  129.  
  130.  
  131.  
  132. * Icons as Parameters to a Script:
  133.  
  134. It is also possible to pass parameters to the script attached to the icon
  135. by "shift-clicking" on several icons in sequence.  The rule here is that
  136. the FIRST icon selected must be attached to a suitable script file (with
  137. a ".KEY" directive); the following files (and their icons) may be of any
  138. type: only the file names (in FULL pathname form) will be passed to the
  139. script as parameters.
  140.  
  141. Note that if the first script in a shift-clicked set does NOT have an
  142. initial period, Xicon will simply run it and move on to the next; once it
  143. finds one that it should pass to EXECUTE, it immediately passes all the
  144. remaining items in the set as parameters (without trying to run them).
  145. (It is not possible to pass shift-clicked icons to a script executed from
  146. a ToolType.)
  147.  
  148.  
  149.  
  150. * Console Interaction:
  151.  
  152. Any script run via EXECUTE is also run in "interactive" mode.  In other
  153. words a command in it that expects input from the console will wait for
  154. it properly.  This was hard to arrange in earlier versions of Xicon: you
  155. had to resort to tricks like opening a special input window.  [Actually a
  156. new CLI is being created for this, and terminated when done. If the script
  157. fails, it can dump you into this CLI (and you will see a standard prompt).
  158. (This is also a possibility in IconX, by the way.)  If this happens, simply
  159. type "endcli" to get out; you'll have to click on the close gadget as well,
  160. of course, if the icon doesn't have 'MODE=closewindow'.]
  161.  
  162. Unfortunately nothing ever seems to be entirely free. If any program
  163. invoked by the script accesses the console for input, this also diverts
  164. access away (permanently) from Xicon, meaning that you can no longer
  165. close the window with control-C.  You still have the Close gadget, of
  166. course, or you can set MODE=closewindow to terminate automatically.
  167.  
  168. In some cases also it seems that programs run in this mode may not
  169. pick up a control-C abort themselves , so you STILL may have to use
  170. special tricks.  Sorry.
  171.  
  172.                                + + +
  173.  
  174.  
  175. About the only other advance in this version is that the code is
  176. considerably shorter.  This isn't the result of tightened up source,
  177. but simply the much improved code generation of Lattice 5.0, especially
  178. the direct system calls.  Thanks, JT!
  179.  
  180. [By the way, if this package is still in its original form, you will of
  181. course have noticed the program ("Most") used to display this text.  It is
  182. an Australian program, sent to me on "MegaDisc" -- their own, very nice,
  183. disk magazine. You can find details in the "About" Menu of the program.
  184.  
  185. ...And -- if "Most" is missing, you will be viewing the text through
  186. Xicon's own primitive mechanism.  You might want to take a look at the
  187. ToolTypes in the icons to see how some of Xicon's unique features are
  188. used.  In case you were doubtful, Most can itself of course be a Default
  189. Tool for a text's Project icon, but in this case, I wanted to demonstrate
  190. Xicon's ability to take remedial action if the environment is not correct.]
  191.  
  192.  
  193.                                         Pete Goodeve
  194.                                         December 1989
  195.  
  196.  
  197.  
  198.  
  199.