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 / PRIMITIV.MSH < prev    next >
Text File  |  1992-08-18  |  21KB  |  345 lines

  1. ("drop" "Do nothing with [top] (and so just unstack it).  "normal_message)
  2. ("dup" "Duplicate [top].  "normal_message)
  3. ("pick" "[top] should be some number n.   If these are the objects on
  4.     the stack, starting from the bottom:
  5.     O(n), O(n-1) ...  O(2) O(1) n
  6.     then after the command the stack will look like:
  7.     O(n) O(n-1) ...  O(2) O(1) O(n)
  8.     so that 1 pick is equivalent to dup.  "normal_message)
  9. ("swap" "Exchange [top] and [top+1].  "normal_message)
  10. ("roll" "[top] should be some number n.   If objects on top of  stack
  11.     are:
  12.     O(n), O(n-1) ...  O(2) O(1) n
  13.     after the command they will be:
  14.     O(n-1) ...  O(2) O(1) O(n)
  15.     so that 2 roll is equivalent to swap.  "normal_message)
  16. ("stack_size" "push as a number the size of the stack.  "normal_message)
  17. ("not" "Push false if [top] is not false, true otherwise.  "normal_message)
  18. ("=" "If [top]=[top+1], push [top] else push false.  "normal_message)
  19. ("&" "push the catenation of [top] and [top+1].  "normal_message)
  20. ("match" "If [top] matches [top+1], push [top] else push false.  "normal_message)
  21. ("cutfirst" "Cuts [top+1] at [top], that is look  for first occurence  of
  22.     string [top] in [top+1], and replace [top] and [top+1] by the
  23.     part of [top+1] after [top] and the  part of [top+1]  before
  24.     [top]  (the  first  may  be  empty if  [top] does  not occur  in
  25.     [top+1]).  "normal_message)
  26. ("cutlast" "Like  cutfirst,  but  looks  for  last  occurence  of  [top]  in
  27.     [top+1].  "normal_message)
  28. ("length" "push the length of the string [top].  "normal_message)
  29. ("substring" "extract  from  [top+2]  the  substring  which  starts  with  the
  30.     [top+1]th character and ends with the [top]th character, and
  31.     push it on the stack.  "normal_message)
  32. ("if" "If [top+1] is not false execute [top] else do nothing.  "normal_message)
  33. ("ifnot" "If [top+1] is false execute [top] else do nothing.  "normal_message)
  34. ("ifelse" "If [top+2] is false execute [top] else execute [top+1].  "normal_message)
  35. ("while" "While  execution  of  [top+1]  does  not  yield  false,  execute
  36.     [top].  "normal_message)
  37. ("#" "Interpret the string [top] as a piece of code and execute it.  "normal_message)
  38. ("@" "Interpret [top] as an identifier name and replace it by  its
  39.     value.  If the value is a piece of code, it is ``uncompiled''
  40.     as a character string.  "normal_message)
  41. ("isdefined" "Interpret [top] as an identifier name.   Push  true if  this
  42.     identifier has been assigned a value, false otherwise.  "normal_message)
  43. ("!" "Interpret [top] as an identifier name and assign [top+1]  to
  44.     it.  "normal_message)
  45. ("+" "Push [top+1]+[top](interpreted as numbers).  "normal_message)
  46. ("-" "Push [top+1]-[top](interpreted as numbers).  "normal_message)
  47. ("*" "Push [top+1]*[top](interpreted as numbers).  "normal_message)
  48. ("/" "Push [top+1]/[top](interpreted as numbers).  "normal_message)
  49. ("<" "Push  true  if  [top+1]<[top](interpreted  as  numbers),  false
  50.     otherwise.  "normal_message)
  51. ("le" "Push  true  if  [top+1]<=[top](interpreted  as  numbers),  false
  52.     otherwise.  "normal_message)
  53. (">" "Push "true" if [top+1]>[top](interpreted as numbers),  false
  54.     otherwise.  "normal_message)
  55. ("ge" "Push "true" if [top+1]>=[top](interpreted as numbers), false
  56.     otherwise.  "normal_message)
  57. ("debug" "System  variable.    If  \"true\",  MSH  is  in  ``debug''  mode:
  58.     before any identifier is executed, a window pops up  showing
  59.     it and the current state of the stack.  "normal_message)
  60. ("panel.install" "Creates  a  new  panel.     Only  one  panel  displaying
  61.       nothing (with number 1) exists at the  start.   Other
  62.       panels  must  be  created  with  this  command.     One
  63.       argument must be given on [top], the initial selection
  64.       pattern  of  the  newly  created  panel.    The  current
  65.       panel is set to the created panel.   Other attributes
  66.       of a panel are set/modified with the following system
  67.       variables.     panel.install  pushes  one  result,  the
  68.       number assigned to the panel.  "normal_message)
  69. ("panel.pattern" "System  variable.    Represents  the  `pattern'  of  the
  70.       current panel (the selection pattern displayed at the
  71.       top  of  the  panel).    Setting  this  variable  causes
  72.       the  panel  to  be  refreshed  by reading  from disk  the
  73.       list  of  files  matching  the  pattern (the  father  and
  74.       subdirectories  of  the  current  directory  are  always
  75.       displayed).     As  a  special  facility,  this  can  be
  76.       assigned  a  pathname  composed  of  the  pathname  of  a
  77.       ``.zip'' or ``.arj'' archive file + a  pattern.   The
  78.       panel will then display the list of all files  inside
  79.       that  archive  which  correspond  to  the given  pattern.
  80.       We  might  add  support  for  other  kinds  of  archives
  81.       (.lzh, .arc, .zoo) in the future.  "normal_message)
  82. ("panel.type" "Returns  the  type  of  the  current  panel:    \"\"  for
  83.       ordinary panels,\".zip\" for a zip archive, \".arj\" for
  84.       an arj archive.  "normal_message)
  85. ("panel.sort" "System  variable.    Represents  the  sort  order of  the
  86.       current  panel.    It  can  be  assigned  the  following
  87.       values:
  88.   \"N\" --- sort the panel by name;
  89.   \"S\" --- sort the panel by size;
  90.   \"T\" --- sort the panel by date;
  91.   \"E\" --- sort the panel by extension.  Sorting by extension
  92.       keeps as a secondary key the previous sort,  whatever
  93.       it was.   This is reflected in the highlighted titles
  94.       at the bottom of the panel.It also means that in  the
  95.       case of an extension sort, the value of panel.sort is
  96.       actually one of\"EN\", \"ES\" or \"ET\".  "normal_message)
  97. ("panel.size" "Boolean  system  variable  which  controls  whether  the
  98.       file size is displayed for each file  of the  current
  99.       panel.  "normal_message)
  100. ("panel.attrs" "Like panel.size, controls whether the read/write/system--
  101.       /hidden attributes are displayed.  "normal_message)
  102. ("panel.date" "Like  panel.size,  controls  whether  the  last  modified
  103.       date is displayed.  "normal_message)
  104. ("panel.time" "Like  panel.size,  controls  whether  the  last  modified
  105.       time is displayed.  "normal_message)
  106. ("panel.sec" "Like  panel.size,  controls  whether  the  last  modified
  107.       time is displayed up to the second.  "normal_message)
  108. ("panel.on" "Boolean system variable.  Controls whether the current
  109.       panel is on.   When off, the panel won't be displayed;
  110.       this is useful to have temporarily an unimpeded  view
  111.       of  the  screen  behind  the  panel (in  addition to  the
  112.       panels, the menu bar can be shut off by  uninstalling
  113.       it;  this  allows  the  use  of  MSH  as  a  ``silent''
  114.       background task).  "normal_message)
  115. ("panel.rc" "System  variable  representing  the  number  of rows  and
  116.       columns  of  the  current  panel.    When  read causes  2
  117.       values to be pushed on the stack, first the number of
  118.       lines and then the number of columns.   Similarly  it
  119.       should be set by pushing 2 values on the stack  (e.g.
  120.       12 40 panel.rc!).  "normal_message)
  121. ("panel.startrc" "System variable.   Represents the start row and start
  122.       column of the current panel (the  coordinates of  the
  123.       top left corner).  "normal_message)
  124. ("panel.nbfiles" "push the total number of entries of the current panel.  "normal_message)
  125. ("panel.att" "Function  taking  4  arguments  representing  the  video
  126.       attributes used to display the pattern.   They should
  127.       be given in ANSI format and represent:
  128.       Normal --- the normal attribute for files in a panel;
  129.       Current --- the attribute of current  name,  the file
  130.       pointed to by the cursor;
  131.       Selected --- the attribute of selected files;
  132.       Selected + Current --- the attribute of current  name
  133.       when it happens to be a selected file.  "normal_message)
  134. ("current.name" "push the filename of the entry pointed by the  cursor
  135.       in  the  current  panel  (this  entry  will  be  called
  136.       `current name' in the subsequent descriptions).  "normal_message)
  137. ("current.isdir" "push  false  if  current  name  is  not  a  directory,
  138.       otherwise push current name (usable as a predicate).  "normal_message)
  139. ("current.size" "push the size (in bytes) of current name.  "normal_message)
  140. ("current.time" "push the last modified time of  current name.    This
  141.       time is encoded as an integer by the formula:
  142.  
  143.                         2x(seconds+
  144.                        32x(minutes+
  145.                        64x(hours+
  146.                        32x(days+
  147.                        32x(months+
  148.                        16x(years-1980)))))) "normal_message)
  149. ("current.selected" "System variable whose value is true or false.  Setting
  150.       it  to  true  selects  current  name;  this  highlights
  151.       it  and  marks  it  as  ``selected''  which  means  that
  152.       current.selected  will  return  true  until  it is  again
  153.       deselected by setting current.selected to false.  "normal_message)
  154. ("current.pos" "System variable which represents the position of  the
  155.       cursor  in  the  current  panel  relative  to  the  total
  156.       number  of  files.    Setting  this  variable  moves  the
  157.       cursor.   Values outside of the interval [0,panel.nb-
  158.       files-1] are mapped to 0 or panel.nbfiles-1.  "normal_message)
  159. ("menu.install." "The  way a  menu
  160. works is by executing actions (pieces of code) associated to fields in its
  161. window (``menu selections'').  When a menu is active, the cursor keys move
  162. between menu selections.   The currently highlighted selection is executed
  163. when pressing the key Enter or when  clicking with the  mouse on  it.   An
  164. Escape or clicking outside a selection  field quits the  menu without  any
  165. selection being done.   The arguments to menu.install describe  completely
  166. the menu.  They are in order:
  167.   - A list of actions (pieces of  code) to  be executed  for various  menu
  168.     selections.
  169.   - A string, the text of the menu window.  Fields which should operate as
  170.     menu selections are delimited by % in that string (a  % can be put  in
  171.     the menu by doubling it:   %%).   The fields are matched to actions in
  172.     order.  There should be exactly as many actions as there are fields.
  173.   - An  action  which  is  executed  when  the  menu  is  exited  without  any
  174.     selection made (often the empty action  () is  suitable).   This  will
  175.     occur when the user has activated a menu and then hits ESC.
  176.   - The  coordinates  of  where  to  put the  upper left  corner  of the  menu
  177.     window (a\"-1\" means center the menu in that direction).
  178.   - Three video attributes given as ANSI strings, to use for displaying the
  179.     menu:
  180.     Normal --- the attribute for normal text in the menu window;
  181.     Selection --- the attribute of a menu selection;
  182.     Highlighted --- the attribute of the highlighted menu selection;
  183.   - A string which determines what kind of border the menu should have, and
  184.     if it should have a title:
  185.     \"\" --- no border.
  186.     \":\" --- single line border.
  187.     \"v:\" --- single line horizontal / double line vertical border.
  188.     \"h:\" --- single line vertical /double line horizontal border.
  189.     \"vh:\" --- double line vertical /double line horizontal border.
  190.     To  specify  a  title  add  it to  the  string.   For  example,\"v:Hello\"
  191. specifies a border with double vertical lines, and single horizontal lines,
  192. with 'Hello' as title.
  193.   - A boolean value wich determines if the menu should be permanent.
  194.     For a permanent menu, menu.install returns a value, the number assigned
  195. to the menu.  "normal_message)
  196. ("window.activate" "Takes as argument the number of the window to activate
  197.       (panel  or  menu).    An  active  menu  is recognized  by
  198.       having a higlighted selection.   An active panel  has
  199.       a highlighted title (and if any files are  displayed,
  200.       current  name  is  highlighted).     When  activating  a
  201.       panel, the action panel.on_activate is executed.   This
  202.       can be set by the user; in the default  configuration
  203.       what it does is attach to the directory of the panel.
  204.       An active window is put on top of the others.  "normal_message)
  205. ("window.uninstall" "Takes as argument the number of the window to delete;
  206.       deletes that window (menu or panel).  "normal_message)
  207. ("message" "Display [top] as a message with title [top+1].   This message
  208.    is left displayed until any key is typed.  If the text of the
  209.    message does not fit on the screen, it is shown screenful  by
  210.    screenful until the end.  This can provide a primitive kind of
  211.    browser.  "normal_message)
  212. ("flash" "Display [top] as a message with title [top+1].   This message
  213.    is left displayed for the number of milliseconds specified by
  214.    [top+2].  "normal_message)
  215. ("ok" "Display [top] as a message and ask confirmation with a Yes No
  216.    choice.   Replaces [top] by false in case of non confirmation
  217.    (so may be used as a predicate).  "normal_message)
  218. ("input" "Display [top+1] as a message and ask for input in a  field of
  219.    length [top].  The input is pushed on the stack.  "normal_message)
  220. ("get_key" "Display [top] as a message with title [top+1].   Return as  a
  221.    character string the name of the first key typed.  "normal_message)
  222. ("alert_att" "System variable whose value represents (in ANSI format)  the
  223.    color attribute to be used for the message, flash, ok, input
  224.    and  get_key  windows.    (``alert''  refers  to  the  temporary
  225.    ``pop-up''  windows  of  MSH:  the  ones  mentioned  above,  the
  226.    warnings and the debug window)."normal_message)
  227. ("cmd.del" "Delete the current character in the command line.  "normal_message)
  228. ("cmd.pos" "System variable representing the position of the  cursor
  229.    in the command line (first position is 0).  "normal_message)
  230. ("cmd.wordleft" "Go one word left in the command line.  "normal_message)
  231. ("cmd.wordright" "Go one word right in the command line.  "normal_message)
  232. ("cmd.clear" "Reset to zero the command line.  "normal_message)
  233. ("cmd" "System variable representing the command line.   Reading
  234.    it pushes the command line contents.   Setting it writes
  235.    [top]  to  the  command  line;  but note  that  the text  is
  236.    added  to  the  command  line  where the  cursor  is in  it.
  237.    Call cmd.clear first to replace the command line contents
  238.    by new contents.  "normal_message)
  239. ("cmd.imode" "Boolean system variable representing if the command line
  240.    is in insert mode.  "normal_message)
  241. ("read" "Read the file whose name is [top] and push as a string its
  242.   contents.  "normal_message)
  243. ("write" "Writes  (creates  or  appends)  to  the  file whose  name  is
  244.   [top+1] the string [top].  "normal_message)
  245. ("unlink" "removes file whose name is [top].  "normal_message)
  246. ("rename" "renames file whose name is [top+1] to name given by [top].
  247.   As  for  the  DOS  call,  it  is  possible  to  rename  empty
  248.   directories, and to move files between directories of the
  249.   same drive with this call.   pushes [top] if  successful,
  250.   false otherwise (e.g.  target exists or is in a different
  251.   drive).  "normal_message)
  252. ("copy" "copies file whose name is [top+1] to name given by [top].
  253.   [top] will be overwritten if it exists; copy works across
  254.   different  drives.    pushes  [top]  if  successful,  false
  255.   otherwise (e.g.   if there was a disk full on the  target
  256.   drive).  "normal_message)
  257. ("testfile" "Returns  false  if  there  exists  no  file with  name  [top]
  258.   (which includes the case when a directory with name [top]
  259.   exists), otherwise pushes the size and last modified time
  260.   (see format in current.time) of found file.  This routine
  261.   can test if a file exists inside a supported archive type.  "normal_message)
  262. ("tempname" "Creates a temporary file name (a name guaranteed to be  a
  263.   non existent file) in the directory specified by [top].  "normal_message)
  264. ("disk_stats" "pushes the following information on the drive whose letter
  265.   is given by [top] (if [top] is \"\" returns information  on
  266.   current drive):   size of a cluster in  bytes,  number of
  267.   available clusters, total number of clusters.  "normal_message)
  268. ("capture_screen" "Grabs the contents of the screen  as a  string and  push
  269.   it  on  the  stack.    Takes  one  boolean  argument:    if
  270.   true, makes a graphic capture, encoding video attributes
  271.   as  ansi  escape  sequences,  which  allows  to  redisplay
  272.   the screen colors using the built-in browser  of MSH  or
  273.   MS-DOS's ANSI.SYS."normal_message)
  274. ("prog_pathname" "push the pathname of msh.exe.  "normal_message)
  275. ("cwd" "System variable holding the name of the current directory.
  276.   Setting it attaches to the directory whose name is [top].  "normal_message)
  277. ("linescols" "System  variable  holding  the  total  number  of  lines  and
  278.   columns  on  the  screen.    It  may be  used in  conjunction
  279.   with panel.rc and panel.startrc to program a setup for the
  280.   screen.  "normal_message)
  281. ("execute" "Send [top] to command.com to be executed.  "normal_message)
  282. ("magic" "System variable.  If not false, should specify a directory
  283.   where MSH will swap itself out  of memory before  sending
  284.   any  command  to  MS-DOS  for  execution  if it  cannot  swap
  285.   itself to extended memory.  As a special convention, if it
  286.   starts with a `*', it means that swapping  to XMS is  not
  287.   desired.  See ``Technical highlight no.  2''.  "normal_message)
  288. ("page" "Call the built-in browser.   It takes 9  arguments:   the
  289.   name  of  the  file  to  browse followed  by the  coordinates
  290.   of the window for the browser (start  row, start  column,
  291.   number of rows, number of colums) and by the list of video
  292.   attributes to use in the browser:
  293.   Browser  window  ---  the  attribute  of  the window  of  the
  294.   browser.
  295.   Browser highlight --- the attribute of the status line and
  296.   of highlighted text in the browser.
  297.   Empty --- the attribute used when showing empty space  in
  298.   the browser.
  299.   Tab  ---  the  attribute  used  when  showing  tabs  in  the
  300.   browser.  "normal_message)
  301. ("beep" "As its name says.  "normal_message)
  302. ("time" "push   the   current   time   (in   the   same   format   as
  303.   current.time).  "normal_message)
  304. ("timer" "MSH has a ``timer'' which allows you  to do some  actions
  305.   at regular times (which may be used to  show a clock)  or
  306.   after  some  delay  (which  may  be used  to  set an  alarm).
  307.   [top]  should  contain  the  action  to  do  (as a  piece  of
  308.   code) and [top+1] a number specifying how many ticks (1=17
  309.   sec.)   from now this action should be  done.   To do  an
  310.   action repeatedly, you can write an action which contains
  311.   a call to set the timer with itself, e.g.   after (f 1000
  312.   (g)timer)g!   a call to g will execute f repeatedly every
  313.   1000 ticks.  "normal_message)
  314. ("reinit_mouse" "With  some  versions  of  the  Microsoft  mouse  driver  and
  315.   some mouse programs, the mouse driver  in MSH may  become
  316.   inactivated  when  returning  from  execute.    This  command
  317.   reinitializes it (it is not done systematically since  it
  318.   takes 1 to 2 seconds).  "normal_message)
  319. ("mouse.click" "System variable.  Holds the interval between the 2 clicks
  320.   of a mouse double click.   By default nn is 3 which means
  321.   3 ticks (ie 3/17 sec.).   You may want this  to be a  bit
  322.   slower if you are not a Mac user ...  "normal_message)
  323. ("quit" "Quit MSH."normal_message)
  324. "                  ``Language'' functions:
  325. %drop%  %dup%      %pick%      %swap%   %roll%      %stack_size% %not%   %=%      %&%
  326. %match% %cutfirst% %cutlast%   %length% %substring% %if%         %ifnot% %ifelse% %while%
  327. %#%     %@@%        %isdefined% %!%      %+%         %-%          %*%     %/%      %<%
  328. %le%    %>%        %ge%        %debug%
  329.              Panels, menus, windows and mouse support:
  330. %panel.install% %panel.pattern%   %panel.type%       %panel.sort%       %panel.size%
  331. %panel.attrs%   %panel.date%      %panel.time%       %panel.sec%        %panel.on%
  332. %panel.rc%      %panel.startrc%   %panel.nbfiles%    %panel.att%        %current.name%
  333. %current.isdir% %current.size%    %current.time%     %current.selected% %current.pos%
  334. %menu.install%  %window.activate% %window.uninstall% %message%          %flash%
  335. %ok%            %input%           %get_key%          %alert_att%
  336.                                Command line:
  337. %cmd.del%       %cmd.pos%       %cmd.wordleft%    %cmd.wordright%
  338. %cmd.clear%     %cmd%           %cmd.imode%
  339.                                Other:
  340. %read%         %write%       %unlink%         %rename%        %copy% %testfile%
  341. %tempname%     %disk_stats%  %capture_screen% %prog_pathname% %cwd%  %linescols%
  342. %execute%      %magic%       %page%           %beep%          %time% %timer%
  343. %reinit_mouse% %mouse.click% %quit%"
  344. () "-1" "-1" "hv:Click or <CR> on primitive you want help for" temp_menu
  345.