home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / msh21.zip / MSHFILES.ZIP / STDHLP.MSH < prev    next >
Text File  |  1992-08-19  |  15KB  |  316 lines

  1. ("cur_action" 
  2. "Takes a default action based on the cursored file in the active panel
  3. (i.e., the kind of action that might be associated with pressing
  4. 'Enter').  If the cursored file is a directory, the current working
  5. directory (system variable 'cwd') is updated and a 'refresh'
  6. is issued to the active panel.  If the cursored file
  7. is an ordinary file, a variable whose name is 'extension_xxx'
  8. (where 'xxx' is the extension of the cursored file) is executed
  9. via the system primitive '#'.  An action must have previously
  10. been defined for 'extension_xxx' or an error occurs.  The
  11. default definitions for various extension_xxx are in the file
  12. EXT.MSH (documentation EXT.DOC); the user may customize
  13. this by overriding these definitions and/or adding further
  14. definitions in the file CUSTOM.MSH (documentation CUSTOM.DOC).
  15. act_on_cur presumes no previous stack contents and has no net
  16. effect on the stack."normal_message) 
  17. ("basename"
  18. "[top] = that part of a string that precedes the last dot.  Will be
  19. the entire string if there is no dot within it.
  20.  
  21. Examples: 
  22. if the file FOO.X is cursored in the 'active panel',
  23. current.name basename
  24. puts FOO on top of the stack.
  25. \"my.name.is.sam\" basename
  26. puts my.name.is on top of the stack.
  27. \"hello\" basename
  28. puts hello on top of the stack."normal_message) 
  29. ("cfg_filename" 
  30. "Sets [top] to the concatenation of prog_dir and \"config.msh\"."normal_message)
  31. ("cmdlist"
  32. "This is a list which "remembers" all the commands which were executed
  33. via 'execsave'."normal_message)
  34. ("confirm"
  35. "At entry, [top] should contain a command which is an appropriate
  36. target of 'execute'.  This command is displayed as a message to
  37. the user, and the user is asked if it is OK to execute the command.
  38. If the user says 'OK' (in effect), the command is executed (with
  39. 'execute'), else it is not executed.  In any case, the command
  40. is popped off the stack."normal_message)
  41. ("deselect" 
  42. "All selected files in the current panel are deselected.  No effect
  43. on stack."normal_message)
  44. ("directory"
  45. "[top] = the unit and directory part of a pathname; if the pathname
  46. specifies an ordinary file, the unit and directory part is NOT
  47. followed by a backslash; however, if the unit and directory part
  48. consists of only a unit, the colon is retained.  If the pathname
  49. specifies a directory (see below for criteria), a dot is appended
  50. after its terminating colon or backslash.
  51.  
  52. The criteria for determining if an ambiguous file-specifier
  53. is an ordinary file or a directory are as follows (and are
  54. NOT the same as the corresponding criteria for 'dirpart'):
  55. If the pathname contains one or more backslashes, the
  56. portion up to the last backslash is a directory specifier.
  57. If the pathname contains no backslashes, it is interpreted
  58. as being a directory name (not the name of an ordinary file).
  59.  Note that while these criteria seem 'wrong', they work out
  60. acceptably if 'directory' is used in its proper context and
  61. 'dirpart' is used when it is appropriate.
  62.  
  63. If the full pathname specifies a directory, a dot is appended, e.g.,
  64. \"a:x\\\" -> \"a:x\\.\"  or  \"a:\" -> \"a:.\"
  65. If the full pathname ends with a file (not directory) specification,
  66. nothing is appended:
  67. \"a:\\x\\y.z\" -> \"a:\\x\" or \"a:\\x\" -> \"a:\"
  68.  
  69. Note that 
  70. \"foo.bar\" directory yields \"foo.bar\".
  71.  
  72. Generally speaking, use 'directory' (rather than 'dirpart') when
  73. referring on a directory alone, such as in panel operations.
  74.  
  75. See also 'dirpart'."normal_message) 
  76. ("dirpart" 
  77. "[top] = the unit and directory part of a pathname, followed
  78. by its terminating colon or backslash.
  79.  
  80. The criteria for determining if an ambiguous file-specifier
  81. is an ordinary file or a directory are as follows (and are
  82. NOT the same as the corresponding criteria for 'directory'):
  83. If the pathname ends with a colon or a backslash, it is a
  84. directory.  Else, it is an ordinary file, even if the only
  85. element of the name other than the unit is PRECEDED by a backslash.
  86.  
  87. If the pathname specifies a directory, the trailing backslash (if any)
  88. or the trailing colon is retained and nothing is appended:
  89. \"a:x\\\" -> \"a:x\\\"  or  \"a:\" -> \"a:\"
  90. Else the part up to and including the last backslash (if any) or the
  91. colon (if there is no backslash present) is retained:
  92. \"a:\\x\\y.z\" -> \"a:\\x\" or \"a:x\" -> \"a:\"
  93.  
  94. Note that 
  95. dirpart & filepart (in effect) yields pathname whereas
  96. directory & filepart (in effect) does not necessarily yield pathname.
  97.  
  98. Note also that "foo.bar" dirpart yields "".
  99.  
  100. Generally speaking, use 'dirpart' (rather than 'directory') when
  101. parsing a pathname into its components.
  102.  
  103. See also 'directory'."normal_message) 
  104. ("endsby" 
  105. "[top] = true or false depending on whether or not the last character
  106. of [top + 1] = [top].
  107. Note that 'endsby' pops [top] and [top + 1] off the stack.  Hence,
  108. if you want the stack after endsby to look like
  109. [top] = true/false
  110. [top + 1] = string under examination
  111. the proper sequence is:
  112. dup \"ending_char\" endsby
  113. (if you forget the 'dup' the string under examination will
  114. disappear from the stack)."normal_message) 
  115. ("exec"
  116. "This is a combination of 'execute' and 'reread'; it is
  117. the normal means of executing a program that might add or delete files."
  118. normal_message) 
  119. ("execsave"
  120. "The variable 'cmdlist' is updated by appending first a newline
  121. and then the current contents of the Mi-Shell command-line (i.e., the
  122. system variable 'cmd').  Then the command-line is executed (via
  123. 'execute') and cleared, and a 'refresh' is issued to
  124. the active panel.  There is no net effect on the stack.  Unlike
  125. 'exec' or 'execshow', execsave takes its central argument from
  126. the command-line rather than from the pre-existing [top] of the stack."
  127. normal_message)
  128. ("execshow"
  129. "Executes a command (using the primitive 'execute'), but before doing
  130. so, flashes a message onscreen for 600 milliseconds that the command
  131. is about to be executed.  No effect on the stack."normal_message)
  132. ("extension"
  133. "[top] = that part of a string that follows the last dot.  Will push
  134. false if there is no dot in the string.
  135.  
  136. Examples: 
  137. if the file FOO.X is cursored in the 'active panel',
  138. current.name extension
  139. puts X on top of the stack.
  140. \"my.name.is.sam\" extension
  141. puts sam on top of the stack.
  142. \"hello\" extension
  143. puts \"\" (i.e., false) on top of the stack."normal_message)
  144. ("filepart"
  145. "[top] = the file part (name.extension) of a full pathname, or
  146. \"\" ('false') if the pathname contains no file part (e.g., consists
  147. only of a device name).
  148.  
  149. The file part is that part following (but not including) the
  150. last backslash in the path name (if there are one or more backslashes),
  151. or, if there are no backslashes, everything following the device
  152. name and the colon (if such exists)."normal_message)
  153. ("foreachbase"
  154. "Identical to 'foreachselected' except that only the basename of each
  155. file is passed (instead of the full filename) as an argument to
  156. the target command.  (See 'basename')."normal_message)
  157. ("foreachselected"
  158. "At entry, [top] is presumed to contain an action which takes one
  159. argument; this action is e.g., intended to be used with an executable DOS
  160. program such as 'DEL' (contrast with loop_panels).
  161.  
  162. This action is executed for each 'selected' file in the current 
  163. panel.  If there is no selected file, the action is executed once
  164. (for the cursored file).
  165.  
  166. Pushes nothing on stack.
  167.  
  168. Example:
  169. (\"DEL \" swap & execute false current.selected!) foreachselected
  170. deletes all selected files using the DOS 'del' command, and deselects all."normal_message)
  171.  
  172. ("loop_panels"
  173. "At entry, [top] is presumed to contain an action which takes NO
  174. argument; it is thus intended to be used with a Mi-Shell definition
  175. or primitive, not with an external command such as DIR.  Thus,
  176. in its 'pure' form, loop_panels is used to build other definitions.
  177.  
  178. The action [top] is executed repeatedly for each file in the
  179. active panel, whether or not the file is \"selected\".
  180.  
  181. Nothing is left on the stack by 'loop_panels'.
  182.  
  183. Example:
  184. The following definition ('deselect') is implemented as follows:
  185. ((current.selected(false current.selected!)if)loop_panels)deselect!
  186.  
  187. To use loop_panels for a DOS command such as DEL:
  188. (\"DEL \" current.name & execute) loop_panels
  189. will delete all the files in the current panel."normal_message) 
  190. ("makename"
  191. "[top] = full pathname constructed from two pieces: a path
  192. (device and/or directory) and a filepart (name.extension).
  193.  
  194. The correct usage is:
  195. \"directory_part\" \"file_part\" makename"normal_message) 
  196. ("next"
  197. "The index to the relative file within the current panel ('current.pos')
  198. is advanced by 1.  If, however, it reaches the limit ('panel.nbfiles'),
  199. it is reset to 0.  No impact on stack."normal_message)
  200. ("nextcmd"
  201. "Sets the system variable 'cmd' (and thus the display on the Mi-Shell
  202. command-line) to the next command in the circular list 'cmdlist'.
  203. No assumptions are made about the previous contents
  204. of the stack and the stack is not altered."normal_message)
  205. ("next_dir"
  206. "[top] becomes the directory portion of panel.pattern for the 'next'
  207. panel after the active panel; see 'directory'."normal_message)
  208. ("nl"
  209. "Utility variable whose contents are a newline."normal_message)
  210. ("panel_stats"
  211. "Displays a message showing the total number of files in the active
  212. panel and their total size in bytes, same for selected files, and statistics
  213. about disk usage, and waits for a keypress.
  214. No effect on the stack."normal_message) 
  215. ("prevcmd"
  216. "Sets the system variable 'cmd' (and thus the display on the Mi-Shell
  217. command-line) to the previous command in the circular list 'cmdlist'.
  218. No assumptions are made about the previous contents
  219. of the stack and the stack is not altered."normal_message)
  220. ("prog_dir"
  221. "Uses 'dirpart' to extract the device and directory from
  222. which Mi-Shell is being executed; sets [top] to this value.  A trailing
  223. backslash or colon is present."normal_message)
  224. ("refresh"
  225. "Refills the active panel with the list of files in the current directory
  226. (limited by 'panel.pattern').  No effect on the stack.  It is wise
  227. to issue this command following any operation which might add or
  228. delete files in the current directory, or following any operation
  229. which might change the current directory reflected in the active panel
  230. (or the selection pattern)."normal_message)
  231. ("reread"
  232. "Similar to 'refresh' but less comprehensive; the directory reflected
  233. by the active panel is updated from disk, but no change in the current
  234. directory or selection pattern is reflected.  If the command just
  235. executed might add or delete files, but cannot change the current
  236. directory or the selection pattern, reread is a satisfactory alternative
  237. to refresh (see 'exec')."normal_message)
  238. ("reread_next"
  239. "Temporarily selects the 'next' panel after the active panel and issues
  240. a 'reread' to it, then reselects the active panel.  No effect on
  241. the stack."normal_message)
  242. ("search"
  243. "[top] is interpreted as a regular-expression file-matching pattern.
  244. The filenames in the active panel are matched with the pattern one
  245. by one, starting at the current cursor position and continuing
  246. circularly until either a file is found whose name matches the pattern
  247. or the search wraps back to the start-point.  No indication is given
  248. as to whether the search was successful; at conclusion [top] still
  249. contains the pattern in all cases.  If it is desired to act only
  250. if the search succeeded, you can code something such as:
  251. \"pattern\" search current.name match (code_if_success)(code_if_fail)ifelse"normal_message)
  252. ("selected_list"
  253. "A string is created consisting of the filenames of each selected file,
  254. where each name is separated by a blank, and this string becomes [top].
  255. No command is executed, and the selected files are NOT deselected.
  256.  
  257. Example:
  258. \"pkzip -a myfile \" selected_list & execute
  259. will add all the selected files to the zipfile 'myfile.zip' using
  260. the 'pkzip' shareware utility.
  261.  
  262. Note that using selected_list in this manner does not extend the DOS
  263. command line beyond 127 characters (except in the case of The
  264. Berkeley Utilities, which can accommodate long command lines).  Thus,
  265. the above example will not execute properly if more than a few files
  266. are selected.  This is a DOS, not a Mi-Shell limitation."normal_message)
  267. ("side_by_side"
  268. "Causes the panels to be displayed side-by-side, with each panel occupying
  269. 40 columns.  The active panel is displayed at the leftmost, and remains
  270. the active panel.  No effect on the stack."normal_message)
  271. ("time_convert"
  272. "Converts a filedate and time encoded as in the system variable 'current.time'
  273. into a string of the form hh:mm:ss dd/mm/yy, and sets [top] to this string."normal_message)
  274. ("unit_and_name"
  275. "[top] = that part of string which follows colon.
  276. [top + 1] = that part of string which precedes colon, 
  277. including the colon of this part is not null.
  278. Examples: 
  279. \"C:FOO.X\" unit_and_name
  280. puts FOO.X on top of the stack, and C: next.
  281. \"FOO.X\" unit_and_name
  282. puts FOO.X on top of the stack and \"\" (false) next
  283. \"C:\" unit_and_name
  284. puts \"\" (i.e., false) on top of the stack and C: next"normal_message)
  285. ("with_magic"
  286. "Causes [top] to be executed with 'magic' temporarily set to 'magic_dir'.
  287. Pops [top] but does not alter the permanent setting of the 'magic'
  288. variable."normal_message)
  289. ("with_nomagic"
  290. "Causes [top] to be executed with 'magic' off, regardless of the normal
  291. setting of the 'magic' variable.  Pops [top] but does not alter the
  292. permanent setting of the 'magic' variable."normal_message)
  293. "             some Mi-Shell Standard Definitions
  294.  
  295. These definitions are all found in the file \"STDDEFS.MSH\" which is
  296. part of the Mi-Shell distribution package.  STDDEFS.MSH is read in
  297. by the default operating environment file \"CONFIG.MSH\".  User-written
  298. operating environment files may at their option include STDDEFS.MSH in the
  299. same manner as does CONFIG.MSH.
  300.  
  301. If the following definitions are altered, the Mi-Shell kernel will not
  302. be affected, but the standard configured operating environments such
  303. as CONFIG.MSH will become inoperable, and you will have to build
  304. your own configured operating environment.
  305.  
  306. %cur_action%      %basename%        %cfg_filename%    %cmdlist%         
  307. %confirm%         %deselect%        %directory%       %dirpart%         
  308. %endsby%          %exec%            %execsave%        %execshow%        
  309. %extension%       %filepart%        %foreachbase%     %foreachselected% 
  310. %loop_panels%     %makename%        %next%            %nextcmd%         
  311. %next_dir%        %nl%              %panel_stats%     %prevcmd%         
  312. %prog_dir%        %refresh%         %reread%          %reread_next%     
  313. %search%          %selected_list%   %side_by_side%    %time_convert%    
  314. %unit_and_name%   %with_magic%      %with_nomagic%    "
  315. () "-1" "-1" "hv:Click or <CR> on standard definition you want help for" temp_menu
  316.