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 >
Wrap
Text File
|
1992-08-18
|
21KB
|
345 lines
("drop" "Do nothing with [top] (and so just unstack it). "normal_message)
("dup" "Duplicate [top]. "normal_message)
("pick" "[top] should be some number n. If these are the objects on
the stack, starting from the bottom:
O(n), O(n-1) ... O(2) O(1) n
then after the command the stack will look like:
O(n) O(n-1) ... O(2) O(1) O(n)
so that 1 pick is equivalent to dup. "normal_message)
("swap" "Exchange [top] and [top+1]. "normal_message)
("roll" "[top] should be some number n. If objects on top of stack
are:
O(n), O(n-1) ... O(2) O(1) n
after the command they will be:
O(n-1) ... O(2) O(1) O(n)
so that 2 roll is equivalent to swap. "normal_message)
("stack_size" "push as a number the size of the stack. "normal_message)
("not" "Push false if [top] is not false, true otherwise. "normal_message)
("=" "If [top]=[top+1], push [top] else push false. "normal_message)
("&" "push the catenation of [top] and [top+1]. "normal_message)
("match" "If [top] matches [top+1], push [top] else push false. "normal_message)
("cutfirst" "Cuts [top+1] at [top], that is look for first occurence of
string [top] in [top+1], and replace [top] and [top+1] by the
part of [top+1] after [top] and the part of [top+1] before
[top] (the first may be empty if [top] does not occur in
[top+1]). "normal_message)
("cutlast" "Like cutfirst, but looks for last occurence of [top] in
[top+1]. "normal_message)
("length" "push the length of the string [top]. "normal_message)
("substring" "extract from [top+2] the substring which starts with the
[top+1]th character and ends with the [top]th character, and
push it on the stack. "normal_message)
("if" "If [top+1] is not false execute [top] else do nothing. "normal_message)
("ifnot" "If [top+1] is false execute [top] else do nothing. "normal_message)
("ifelse" "If [top+2] is false execute [top] else execute [top+1]. "normal_message)
("while" "While execution of [top+1] does not yield false, execute
[top]. "normal_message)
("#" "Interpret the string [top] as a piece of code and execute it. "normal_message)
("@" "Interpret [top] as an identifier name and replace it by its
value. If the value is a piece of code, it is ``uncompiled''
as a character string. "normal_message)
("isdefined" "Interpret [top] as an identifier name. Push true if this
identifier has been assigned a value, false otherwise. "normal_message)
("!" "Interpret [top] as an identifier name and assign [top+1] to
it. "normal_message)
("+" "Push [top+1]+[top](interpreted as numbers). "normal_message)
("-" "Push [top+1]-[top](interpreted as numbers). "normal_message)
("*" "Push [top+1]*[top](interpreted as numbers). "normal_message)
("/" "Push [top+1]/[top](interpreted as numbers). "normal_message)
("<" "Push true if [top+1]<[top](interpreted as numbers), false
otherwise. "normal_message)
("le" "Push true if [top+1]<=[top](interpreted as numbers), false
otherwise. "normal_message)
(">" "Push "true" if [top+1]>[top](interpreted as numbers), false
otherwise. "normal_message)
("ge" "Push "true" if [top+1]>=[top](interpreted as numbers), false
otherwise. "normal_message)
("debug" "System variable. If \"true\", MSH is in ``debug'' mode:
before any identifier is executed, a window pops up showing
it and the current state of the stack. "normal_message)
("panel.install" "Creates a new panel. Only one panel displaying
nothing (with number 1) exists at the start. Other
panels must be created with this command. One
argument must be given on [top], the initial selection
pattern of the newly created panel. The current
panel is set to the created panel. Other attributes
of a panel are set/modified with the following system
variables. panel.install pushes one result, the
number assigned to the panel. "normal_message)
("panel.pattern" "System variable. Represents the `pattern' of the
current panel (the selection pattern displayed at the
top of the panel). Setting this variable causes
the panel to be refreshed by reading from disk the
list of files matching the pattern (the father and
subdirectories of the current directory are always
displayed). As a special facility, this can be
assigned a pathname composed of the pathname of a
``.zip'' or ``.arj'' archive file + a pattern. The
panel will then display the list of all files inside
that archive which correspond to the given pattern.
We might add support for other kinds of archives
(.lzh, .arc, .zoo) in the future. "normal_message)
("panel.type" "Returns the type of the current panel: \"\" for
ordinary panels,\".zip\" for a zip archive, \".arj\" for
an arj archive. "normal_message)
("panel.sort" "System variable. Represents the sort order of the
current panel. It can be assigned the following
values:
\"N\" --- sort the panel by name;
\"S\" --- sort the panel by size;
\"T\" --- sort the panel by date;
\"E\" --- sort the panel by extension. Sorting by extension
keeps as a secondary key the previous sort, whatever
it was. This is reflected in the highlighted titles
at the bottom of the panel.It also means that in the
case of an extension sort, the value of panel.sort is
actually one of\"EN\", \"ES\" or \"ET\". "normal_message)
("panel.size" "Boolean system variable which controls whether the
file size is displayed for each file of the current
panel. "normal_message)
("panel.attrs" "Like panel.size, controls whether the read/write/system--
/hidden attributes are displayed. "normal_message)
("panel.date" "Like panel.size, controls whether the last modified
date is displayed. "normal_message)
("panel.time" "Like panel.size, controls whether the last modified
time is displayed. "normal_message)
("panel.sec" "Like panel.size, controls whether the last modified
time is displayed up to the second. "normal_message)
("panel.on" "Boolean system variable. Controls whether the current
panel is on. When off, the panel won't be displayed;
this is useful to have temporarily an unimpeded view
of the screen behind the panel (in addition to the
panels, the menu bar can be shut off by uninstalling
it; this allows the use of MSH as a ``silent''
background task). "normal_message)
("panel.rc" "System variable representing the number of rows and
columns of the current panel. When read causes 2
values to be pushed on the stack, first the number of
lines and then the number of columns. Similarly it
should be set by pushing 2 values on the stack (e.g.
12 40 panel.rc!). "normal_message)
("panel.startrc" "System variable. Represents the start row and start
column of the current panel (the coordinates of the
top left corner). "normal_message)
("panel.nbfiles" "push the total number of entries of the current panel. "normal_message)
("panel.att" "Function taking 4 arguments representing the video
attributes used to display the pattern. They should
be given in ANSI format and represent:
Normal --- the normal attribute for files in a panel;
Current --- the attribute of current name, the file
pointed to by the cursor;
Selected --- the attribute of selected files;
Selected + Current --- the attribute of current name
when it happens to be a selected file. "normal_message)
("current.name" "push the filename of the entry pointed by the cursor
in the current panel (this entry will be called
`current name' in the subsequent descriptions). "normal_message)
("current.isdir" "push false if current name is not a directory,
otherwise push current name (usable as a predicate). "normal_message)
("current.size" "push the size (in bytes) of current name. "normal_message)
("current.time" "push the last modified time of current name. This
time is encoded as an integer by the formula:
2x(seconds+
32x(minutes+
64x(hours+
32x(days+
32x(months+
16x(years-1980)))))) "normal_message)
("current.selected" "System variable whose value is true or false. Setting
it to true selects current name; this highlights
it and marks it as ``selected'' which means that
current.selected will return true until it is again
deselected by setting current.selected to false. "normal_message)
("current.pos" "System variable which represents the position of the
cursor in the current panel relative to the total
number of files. Setting this variable moves the
cursor. Values outside of the interval [0,panel.nb-
files-1] are mapped to 0 or panel.nbfiles-1. "normal_message)
("menu.install." "The way a menu
works is by executing actions (pieces of code) associated to fields in its
window (``menu selections''). When a menu is active, the cursor keys move
between menu selections. The currently highlighted selection is executed
when pressing the key Enter or when clicking with the mouse on it. An
Escape or clicking outside a selection field quits the menu without any
selection being done. The arguments to menu.install describe completely
the menu. They are in order:
- A list of actions (pieces of code) to be executed for various menu
selections.
- A string, the text of the menu window. Fields which should operate as
menu selections are delimited by % in that string (a % can be put in
the menu by doubling it: %%). The fields are matched to actions in
order. There should be exactly as many actions as there are fields.
- An action which is executed when the menu is exited without any
selection made (often the empty action () is suitable). This will
occur when the user has activated a menu and then hits ESC.
- The coordinates of where to put the upper left corner of the menu
window (a\"-1\" means center the menu in that direction).
- Three video attributes given as ANSI strings, to use for displaying the
menu:
Normal --- the attribute for normal text in the menu window;
Selection --- the attribute of a menu selection;
Highlighted --- the attribute of the highlighted menu selection;
- A string which determines what kind of border the menu should have, and
if it should have a title:
\"\" --- no border.
\":\" --- single line border.
\"v:\" --- single line horizontal / double line vertical border.
\"h:\" --- single line vertical /double line horizontal border.
\"vh:\" --- double line vertical /double line horizontal border.
To specify a title add it to the string. For example,\"v:Hello\"
specifies a border with double vertical lines, and single horizontal lines,
with 'Hello' as title.
- A boolean value wich determines if the menu should be permanent.
For a permanent menu, menu.install returns a value, the number assigned
to the menu. "normal_message)
("window.activate" "Takes as argument the number of the window to activate
(panel or menu). An active menu is recognized by
having a higlighted selection. An active panel has
a highlighted title (and if any files are displayed,
current name is highlighted). When activating a
panel, the action panel.on_activate is executed. This
can be set by the user; in the default configuration
what it does is attach to the directory of the panel.
An active window is put on top of the others. "normal_message)
("window.uninstall" "Takes as argument the number of the window to delete;
deletes that window (menu or panel). "normal_message)
("message" "Display [top] as a message with title [top+1]. This message
is left displayed until any key is typed. If the text of the
message does not fit on the screen, it is shown screenful by
screenful until the end. This can provide a primitive kind of
browser. "normal_message)
("flash" "Display [top] as a message with title [top+1]. This message
is left displayed for the number of milliseconds specified by
[top+2]. "normal_message)
("ok" "Display [top] as a message and ask confirmation with a Yes No
choice. Replaces [top] by false in case of non confirmation
(so may be used as a predicate). "normal_message)
("input" "Display [top+1] as a message and ask for input in a field of
length [top]. The input is pushed on the stack. "normal_message)
("get_key" "Display [top] as a message with title [top+1]. Return as a
character string the name of the first key typed. "normal_message)
("alert_att" "System variable whose value represents (in ANSI format) the
color attribute to be used for the message, flash, ok, input
and get_key windows. (``alert'' refers to the temporary
``pop-up'' windows of MSH: the ones mentioned above, the
warnings and the debug window)."normal_message)
("cmd.del" "Delete the current character in the command line. "normal_message)
("cmd.pos" "System variable representing the position of the cursor
in the command line (first position is 0). "normal_message)
("cmd.wordleft" "Go one word left in the command line. "normal_message)
("cmd.wordright" "Go one word right in the command line. "normal_message)
("cmd.clear" "Reset to zero the command line. "normal_message)
("cmd" "System variable representing the command line. Reading
it pushes the command line contents. Setting it writes
[top] to the command line; but note that the text is
added to the command line where the cursor is in it.
Call cmd.clear first to replace the command line contents
by new contents. "normal_message)
("cmd.imode" "Boolean system variable representing if the command line
is in insert mode. "normal_message)
("read" "Read the file whose name is [top] and push as a string its
contents. "normal_message)
("write" "Writes (creates or appends) to the file whose name is
[top+1] the string [top]. "normal_message)
("unlink" "removes file whose name is [top]. "normal_message)
("rename" "renames file whose name is [top+1] to name given by [top].
As for the DOS call, it is possible to rename empty
directories, and to move files between directories of the
same drive with this call. pushes [top] if successful,
false otherwise (e.g. target exists or is in a different
drive). "normal_message)
("copy" "copies file whose name is [top+1] to name given by [top].
[top] will be overwritten if it exists; copy works across
different drives. pushes [top] if successful, false
otherwise (e.g. if there was a disk full on the target
drive). "normal_message)
("testfile" "Returns false if there exists no file with name [top]
(which includes the case when a directory with name [top]
exists), otherwise pushes the size and last modified time
(see format in current.time) of found file. This routine
can test if a file exists inside a supported archive type. "normal_message)
("tempname" "Creates a temporary file name (a name guaranteed to be a
non existent file) in the directory specified by [top]. "normal_message)
("disk_stats" "pushes the following information on the drive whose letter
is given by [top] (if [top] is \"\" returns information on
current drive): size of a cluster in bytes, number of
available clusters, total number of clusters. "normal_message)
("capture_screen" "Grabs the contents of the screen as a string and push
it on the stack. Takes one boolean argument: if
true, makes a graphic capture, encoding video attributes
as ansi escape sequences, which allows to redisplay
the screen colors using the built-in browser of MSH or
MS-DOS's ANSI.SYS."normal_message)
("prog_pathname" "push the pathname of msh.exe. "normal_message)
("cwd" "System variable holding the name of the current directory.
Setting it attaches to the directory whose name is [top]. "normal_message)
("linescols" "System variable holding the total number of lines and
columns on the screen. It may be used in conjunction
with panel.rc and panel.startrc to program a setup for the
screen. "normal_message)
("execute" "Send [top] to command.com to be executed. "normal_message)
("magic" "System variable. If not false, should specify a directory
where MSH will swap itself out of memory before sending
any command to MS-DOS for execution if it cannot swap
itself to extended memory. As a special convention, if it
starts with a `*', it means that swapping to XMS is not
desired. See ``Technical highlight no. 2''. "normal_message)
("page" "Call the built-in browser. It takes 9 arguments: the
name of the file to browse followed by the coordinates
of the window for the browser (start row, start column,
number of rows, number of colums) and by the list of video
attributes to use in the browser:
Browser window --- the attribute of the window of the
browser.
Browser highlight --- the attribute of the status line and
of highlighted text in the browser.
Empty --- the attribute used when showing empty space in
the browser.
Tab --- the attribute used when showing tabs in the
browser. "normal_message)
("beep" "As its name says. "normal_message)
("time" "push the current time (in the same format as
current.time). "normal_message)
("timer" "MSH has a ``timer'' which allows you to do some actions
at regular times (which may be used to show a clock) or
after some delay (which may be used to set an alarm).
[top] should contain the action to do (as a piece of
code) and [top+1] a number specifying how many ticks (1=17
sec.) from now this action should be done. To do an
action repeatedly, you can write an action which contains
a call to set the timer with itself, e.g. after (f 1000
(g)timer)g! a call to g will execute f repeatedly every
1000 ticks. "normal_message)
("reinit_mouse" "With some versions of the Microsoft mouse driver and
some mouse programs, the mouse driver in MSH may become
inactivated when returning from execute. This command
reinitializes it (it is not done systematically since it
takes 1 to 2 seconds). "normal_message)
("mouse.click" "System variable. Holds the interval between the 2 clicks
of a mouse double click. By default nn is 3 which means
3 ticks (ie 3/17 sec.). You may want this to be a bit
slower if you are not a Mac user ... "normal_message)
("quit" "Quit MSH."normal_message)
" ``Language'' functions:
%drop% %dup% %pick% %swap% %roll% %stack_size% %not% %=% %&%
%match% %cutfirst% %cutlast% %length% %substring% %if% %ifnot% %ifelse% %while%
%#% %@@% %isdefined% %!% %+% %-% %*% %/% %<%
%le% %>% %ge% %debug%
Panels, menus, windows and mouse support:
%panel.install% %panel.pattern% %panel.type% %panel.sort% %panel.size%
%panel.attrs% %panel.date% %panel.time% %panel.sec% %panel.on%
%panel.rc% %panel.startrc% %panel.nbfiles% %panel.att% %current.name%
%current.isdir% %current.size% %current.time% %current.selected% %current.pos%
%menu.install% %window.activate% %window.uninstall% %message% %flash%
%ok% %input% %get_key% %alert_att%
Command line:
%cmd.del% %cmd.pos% %cmd.wordleft% %cmd.wordright%
%cmd.clear% %cmd% %cmd.imode%
Other:
%read% %write% %unlink% %rename% %copy% %testfile%
%tempname% %disk_stats% %capture_screen% %prog_pathname% %cwd% %linescols%
%execute% %magic% %page% %beep% %time% %timer%
%reinit_mouse% %mouse.click% %quit%"
() "-1" "-1" "hv:Click or <CR> on primitive you want help for" temp_menu