home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
mumps
/
utility.doc
< prev
next >
Wrap
Text File
|
1989-03-06
|
25KB
|
860 lines
MICROMUMPS
UTILITY ROUTINES
Division of Computer Science
University of California
Davis, CA 95616
December, 1986
(updated March 1989)
(version 5.2 )
(marked '***')
SETMUMPS -- Interpreter Configuration
SETMUMPS is an assembly language utility that allows you to re-
configure a MUMPS system. The parameters that can be modified are
the partition size (which indirectly determines the space available
for routine and global buffers), default drive assignments for I/O ***
and error message files, default drive, path (subdirectory) and
name assignment for the routine library and global file, substitu- ***
tion of another error message file (e.g., for foreign language
messages), modification (or setting) of the clear screen string so
that W # will work properly, the facility for an auto-execute mode,
and the ability to disable control-C and control-G interrupts. To
use, type SETMUMPS and follow the instructions as shown in the
dialogs below. You will be given options to change each parameter
listed, with the current value also provided. Typing <return>
in response to any question will skip to the next question. When
entering the clear screen string characters, type an 'H' or 'h'
after the hexadecimal character, otherwise it's assumed to be decimal.
The default drives can be any letter from 'A' to 'P', corresponding
to drives A to P, or '*'. Selection of '*' as a drive allows the
default drive to be determined at run time, where the choice will
be the current system drive. The `default I/O drive' referred to
below relates to .MMP routines existing outside the MUMPS environ-
ment. For example, to copy any MUMPS routines from versions prior
to 5.0, the disk drive containing those routines would be specified
by the default I/O drive. When auto-execute mode is used, the MUMPS
interpreter automatically starts executing a predetermined routine
sequence. Auto-execute mode is set up by typing 'Y' to the auto-
execute question. Any time control would return to direct mode,
an exit is made to the operating system instead, isolating the user
entirely from the MUMPS environment. The following examples
illustrate different responses to SETMUMPS prompts:
A:\>setmumps<RET>
MUMPS 8086/88 version 4.9 setup utility July 1988 [version number may vary]
Enter drive of the MUMPS to change: b<RET>
Enter partition size in bytes (8192): 6000<RET>
That leaves 52951 bytes for routine and global buffers
Is that enough room (Y/N)? y<RET>
Enter default global drive -- A-P,* -- (A): b<RET>
Do you want to change the global file name? (Y/N) y<RET> ***
Enter name for new global file name: mumps\newglob<RET> ***
[NOTE: Do NOT enter drive designation or '.DAT'] ***
Enter default I/O drive --A-P,* -- (A): b<RET>
Currently the routine-file pathname is: ROUTINES.RTN ***
Do you want to change it (Y/N) n<RET>
Enter default error message drive -- A-P,* -- (A): <RET>
Do you want to change the error message file name? (Y/N) n<RET>
Currently the clear screen string is (decimal) -- 27 91 50 74
(hexadecimal) -- 1B 5B 32 4A
Do you want to change it? (Y/N) n<RET>
Currently the auto-execute command is undefined
Do you want to change it? (Y/N) n<RET>
Control-C breaking is currently enabled
Do you want to change it? (Y/N) n<RET>
Control-G talk-through is currently disabled
Do you want to change it? (Y/N) n<RET>
The MUMPS standard specifies 9 significant digits for numeric representation
You may change it with the range of 1 to 14 digits.
Enter number of significant digits (9): <RET>
The new configuration of MUMPS is saved
A:\>setmumps<RET>
MUMPS 8086/88 version 4.9 setup utility July 1988
Enter drive of the MUMPS to change: a<RET>
Enter partition size in bytes (6000): 8192<RET>
That leaves 52951 bytes for routine and global buffers
Is that enough room (Y/N)? y<RET>
Enter default global drive -- A-P,* -- (A): a<RET>
Do you want to change the global file name? (Y/N) n<RET> ***
Enter default I/O drive --A-P,* -- (A): a<RET> [for .MMP files]
Currently the routine-file pathname is: ROUTINES.RTN ***
Do you want to change it (Y/N) y<RET>
Enter new pathname (40 max): B:\FMGR\ROUTINES.DAT<RET>
[NOTE: You MAY enter drive designation and you MUST enter both ***
the filename and the three character extension] ***
Enter default error message drive -- A-P,* -- (A): <RET>
Do you want to change the error message file name? (Y/N) <RET>
Currently the clear screen string is (decimal) -- 27 91 50 74
(hexadecimal) -- 1B 5B 32 4A
Do you want to change it? (Y/N) <RET>
Currently the auto-execute command is undefined
Do you want to change it? (Y/N) y<RET>
Enter the MUMPS commands to auto-execute
D ^DI
Control-C breaking is currently enabled
Do you want to change it? (Y/N) y<RET>
It's changed
Control-G talk-through is currently disabled
Do you want to change it? (Y/N) y<RET>
It's changed
The MUMPS standard specifies 9 significant digits for numeric representation
You may change it with the range of 1 to 14 digits.
Enter number of significant digits (9): <RET>
The new configuration of MUMPS is saved
- 2 -
SETGLOB.EXE - Global File Initialization
SETGLOB.EXE is an assembly language utility that creates an empty
global file (default name is GLOBALS.DAT). To use type 'SETGLOB.' ***
When asked for a drive, enter the letter only of the drive to put
the global file on. SETGLOB will then ask for a file name. The ***
extension is assumed and will always be '.DAT'. If the file already ***
exists in that subdirectory, an error message is printed and the ***
program halts. Note that this utility clears all globals from the
data base. The next question is about the maximum size of the global
file in Kbytes. (One Kbyte equal 1024 Bytes.) This value must be ***
between 1 and 48000. (NOTE: A 360KB floppy holds 353 Kbytes and ***
most versions of DOS have a 32,000 Byte file size limit). A file of ***
the size specified is allocated at this time, and bitmaps are created
to allow MUMPS to allocate and deallocate space within the globals
file. The globals file will always be created in the subdirectory ***
in which SETGLOB was run. ***
The distribution disk has a very small global file created. This
file is sufficient to demonstrate MUMPS functions, but it should
not be used when creating permanent data. It certainly is nowhere ***
near large enough to run the VA FileManager routines. ***
Errors will be generated if the user attempts to write beyond the
upper limit of the global file. A warning is issued when only 7
or so blocks are available (slightly over 5 K bytes). It is pos-
sible to continue writing to globals at this time, but the user
should be very cautious about doing so. It is better to purge or
save the existing global so that new data can be accommodated.
SAMPLE RUN:
A:\>SETGLOB
Which drive do you want the globals on? A<ret>
Enter name for globals file or <cr> for "GLOBALS" (assumed typ is DAT): ***
>NEWGLOB<ret> ***
Enter the maximum size for your globals file (K-Bytes): 200
[note: the system will write 0s in the file. Depending on the
size, this may take a few minutes.]
The global file is initialized.
A:\>
- 3 -
SETROUT.EXE - Routine File Initializer
SETROUT.EXE is an object code program that initializes a Routine
Library used in Version 5.0 and later releases of UCD MicroMUMPS.
Routines in these releases are stored in a single library file
with a B-Tree directory that facilitates fast searching for the
routines on disk. The purpose of this program is to create the
initial disk and set up the beginning directory table for rou-
tines.
Once SETROUT has been run, routines can be loaded into this file
using the ZFETCH command described in the User Manual.
SETROUT give you the option of establishing a Routine Library
under any name that you may select. The default name is
ROUTINES.RTN, but you may define other Library files with other ***
names to allow grouping of routines for different applications.
The following lines illustrate sample executions of SETROUT
EXAMPLE 1: A:\>setrout
SETROUT.EXE version 1.1
Enter pathname of desired data file: ROUTN.LIB
FILE HAS BEEN CREATED
terminating SETROUT.EXE
A:\>DIR
ROUTN LIB 3072 12/20/86 2:54p [directory information]
EXAMPLE 2: In this example, the user wishes to use a complete pathname:
A:\>setrout
SETROUT.EXE version 1.1
Enter pathname of desired data file : C:\APPLIC1\ROUTINES.DAT
FILE HAS BEEN CREATED
(Note that the path subdirectory \APPLIC1 must exist in order to
create this file. The user can then use either SETMUMPS to de-
fault to this file or run ZOPTION as specified in the User Manual
during execution to redirect MUMPS to this file for executable
routines.)
The actual amount of space used by routines stored in a library
is roughly comparable to the storage space required by the same
routines in the .MMP format. However, there are two advantages to
the library format. First, access to the routines is a great deal
faster, because of the directory pointing to the start of each
routine. Second, the library file uses only one Root directory
entry or one file entry in a path subdirectory; hence, directory
space is conserved and access to a single file will obtain all
routines stored in that library.
- 4 -
TK Communication Routines
The TK routines provide a general purpose file transfer utility
capability between MUMPS systems. Currently, it will send and re-
ceive, with full handshaking, error detection and retransmission,
MUMPS routines, MUMPS globals, and ASCII files. Without any
changes, the utility will run between two microMUMPS systems that
have the auxiliary input and output ports assigned to an external
serial line. With minor changes, routine and global transfers
can be made with other systems (not MicroMUMPS).
Sample uses:
Following is a sample dialog for transfers between systems with
an operator at each system:
*****to send:
>D ^TK
Are you connected to the remote system as a terminal (Y/N)? N
Do you wish to send or receive (R/S) ? S
Sending routines, globals, or ASCII files (R/G/F) ? R
Do you want outgoing data displayed (Y/N) ? N
Option -- ADD
Enter the routine name: %M
Enter the routine name:%M0
Enter the routine name:
Option -- LIST
%M %M0
Option --
Routine %M being sent -- Sent
Routine %M0 being sent -- Sent
Successful completion
>
****to receive
Are you connected to the remote system as a terminal (Y/N)? N Do
you wish to send of receive (R/S) ? R Receiving routines, glo-
bals, or ASCII files (R/G/F) ? R Do you want the incoming data
displayed (Y/N) ? N
Routine %M being received -- Received Routine $M0 being received
-- Received
Successful completion
- 5 -
Following is a sample dialog illustrating transfers between sys-
tems with an operator at only one of the two machines.
****to send:
>D ^TK
Are you connected to the remote system as a terminal (Y/N)? Y
Do you wish to send or receive (R/S) ? S
Sending routines, globals or ASCII files (R/G/F) ? G
Do you want outgoing data displayed (Y/N) ? N
Option -- ADD
Enter the global name: %MU
Enter the global name: %MTC
Enter the global name:
Option -- LIST
%MU %MTC
Global %MTC being sent -- Sent
Global %MTC being sent -- Sent
Successful completion
****to receive:
>D ^TK
Are you connected to the remote system as a terminal (Y/N) ?Y
Do you wish to send or receive (R/S) ? R
Receiving routines, globals, or ASCII files (R/G/F) ? R
Do you want incoming data displayed (Y/N) ? N
Enter routine name: VV
Enter routine name: VVAC
Enter routine name:
Routine VV being received -- Received
Routine VVAC being received -- Received
Successful completion
Comments The first question would be answered yes (Y) only if
there is one operator controlling the entire process, i.e., the
MUMPS system is effectively acting as a terminal to another MUMPS
machine. Answering yes (Y) to the question about displaying in-
coming data will cause all data being transferred also to appear
on the screen.
When sending data, it is necessary to create a list of the rou-
tines, globals, or ASCII files to be transmitted. Unfortunately,
the package was developed independently of the Lewkowicz utili-
ties, so there is no connection between the selection process
used in these routines and the %M routines.
- 6 -
When transferring to an un-manned remote system, the following
procedure is used. Start MicroMUMPS until the first prompt. Then
type control-G to begin talk-through mode. Now your MUMPS acts as
a terminal to the remote system. Everything typed is displayed
and sent out to the remote system. Everything received is also
displayed. When you have logged in, type control-G again to re-
turn to MicroMUMPS. Start the TK procedure described above. When
the transfer is complete, log off the remote system by typing
control-G, logging out, and typing control-G again to return to
local mode.
Note: The TK routines permit use of ``wild card'' notation to
specify names of routines, globals, or file to be transmitted.
Thus, %* will transfer all names starting with %, and VV? will
transfer all three letter names starting with VV.
- 7 -
%COPY - Global Utility
%COPY is a global utility which will copy globals in a MicroMUMPS
environment. It uses implementation features specific to MicroMUMPS.
%COPY will allow one to copy one or more globals from a GLOBALS.DAT
file on one disk to another GLOBALS.DAT file found on a second disk.
TO RUN %COPY:
>D ^%COPY
THIS ROUTINE COPIES GLOBALS FROM AN EXISTING GLOBALS.DAT FILE ON
ONE DRIVE TO AN EXISTING GLOBALS.DAT FILE ON ANOTHER DRIVE.
DO YOU WANT TO CONTINUE?(DEFAULT/"NO"):
ENTER DRIVE TO READ GLOBALS FROM (A-P):a
ENTER DRIVE TO WRITE GLOBALS TO (A-P):c
GLOBALS LIST:
%X
TOTAL NUMBER OF GLOBALS IS ... 1
DO YOU WISH TO STORE "%X"?(DEFAULT/"NO"):
DONE
>
%DATE - Date Utility
Purpose: to return, from $HOROLOG internal storage format, the
correct date, stored in the variable %DT. This routine calculates
date from the value typed in at sign-on time in some systems, or
the value available from the system in implementation where that
information is available (such as the IBM PC.)
%DUMP - Global Display Utility
%DUMP is a global utility which will display or print the contents
of any global in a MicroMUMPS environment without prior knowledge
of the global structure. It uses implementation features specific
to MicroMUMPS.
TO RUN %DUMP:
>D ^%DUMP
LIST OF GLOBAL VARIABLES
%X
ENTER GLOBAL VARIABLE NAME:
WOULD YOU LIKE THE OUTPUT TO GO TO THE PRINTER? /NO/:
[The computer will display the global as follows:
%X(1) xxxxxxxx
%X(2) yyyyyyyy
>
- 8 -
%EDIT - General Purpose Editor
This is a general purpose editor with relatively simple opera-
tions. It may be used for short fixes, expecially changing a few
characters on a line. It does not contain the sophisticated docu-
mentation capability found in the %M routines, which should be
used for applications development. We consider it a ``quick and
dirty'' editor useful for short on-line changes.
The program is executed first by typing:
>DO ^%EDIT
This invokes the editor and creates a global file ^%, which is
then used to edit a routine or global. When complete, the program
types:
THE EDITOR IS LOADED. EDITOR HELPED TEXT IS
LOADED
To execute this global file, type
XECUTE ^%
The response from this command is a new prompt: >>, which appears
as long as you are in the editor global. To exit the editor,
type a return when this prompt appears.
All commands operate on the current ZLOADED routine. There are
several commands that may be invoked through the editor. To enter
a command type in the first letter only and answer additional
prompts as indicated.
? Displays a summary of commands available.
B (Backup routine): save a routine on drive A as
(name).SAV, to provide a backup version, or to use another ed-
itor.
R (Restore routine): Restores a routine previously backed
up.
C (Change): the program then asks for the label+offset of
the target line. After you type that line identification,
the program lists the line, and asks for the string that you
wish to replace, then types the line up to that string, asks
for the replacement, and, when you type a return, completes
the line beyond the text that you have replaced. It repeats
this request (on the same line) until you type a return with
no other characters in response to a REPLACE statement. It
then returns you to the general editor for other commands.
This option can also be used directly from the >> prompt by
typing in a label with optional offset followed by one space.
Globals may be edited using the same facilities by entering a
full global reference at the >> prompt.
D (Delete): asks for label+offset. Deletes that line.
I (Insert): insert before a (label+offset) line. When in-
serting, use a blank (space) for linestart character. Ter-
minate insert mode with a blank line.
- 9 -
L (List): lists from label+offset to label+offset.
S (Search For): lists all lines in which the target string
is found, with a >below the string.
E (Every Occurence): replaces every occurence of one
string with another in the current routine. Note that STACK
OVERFLOW messages may appear when editting very long lines of
code with this option.
In addition, any direct mode command(s) may be executed from
the >> prompt, for example, ZPRINT to print the entire rou-
tine. Note that ZLOADing a new routine to edit must be per-
formed at the > prompt, not in the editor.
When you have completed the use of the editor, you should resave
your routine using the ZSAVE command.
%INDEX
Utility Cross Reference Listing Package
This utility is a package that accepts one or more MUMPS routines
and generates cross reference information as well as syntax
checking. The package was originally part of aa large number of
routines that were a portion of the DOC package distributed with
QUEST by the MUMPS Users' Group. Robert Lushene (Veterans Ad-
ministration, Florida) modified the routines to fit into a few
routines that still provide the basic benefits of the larger
package.
In order to run the cross reference programs, one should type DO
^%INDEX. This program then asks the name of the routine(s) to be
analyzed and asks further for output options (a note of unrefer-
enced labels, print index, list routines and print errors and
warnings). During execution, the program outputs a period for
each line that it has processed. At the conclusion of the
analysis of the routines, the requested output is produced on the
current output device.
This package is helpful, not only in identifying the use of vari-
ables and possible missing referenced labels, but it also will
note syntax problems encountered in programs, thereby providing a
rapid verification of the accuracy of programs before they are
executed.
The programs use mostly local variables. In addtion, global
variables ^XCR and ^UTILITY are used during execution and killed
thereafter.
- 10 -
%SHOW
%SHOW is a MUMPS routine to dump out random portions of an ASCII
file. It is also an example of some of the new features included
in MicroMUMPS. %SHOW asks for a file name and drive and then
checks to see if the file is present. If so, a record number is
requested. By entering a number between 0 and the file size (in
128 byte records), the file starting at that point is dumped out.
Invalid record numbers are checked for. Instead of a record
number, a RETURN can be typed, in which case the dump will start
at the sector after the previous dump. Enter Q or q to exit %SHOW.
The features found in %SHOW start on the second line, %SHOW+1,
where an error trap is enabled to label ERR. At ENTER+1, $ZR is
used to save the current routine drive in variable DR. At
ENTER+2, a post-conditional on ZO may change the routine drive.
The next new feature is found in the line at DSP+3, where device
2 is to be USEd at record NS to do the random read. At END, the
routine drive may be changed back to what it was on entry to
SHOW. The error trapping at ERR at the end uses the new form of
the error trap message to determine if an error 48 (invalid
parameter) occurred. If so, the record number entered was bad, in
which case a message is written, the error trap is re-enabled,
and control is given back to the program. Any other error causes
exit of the program.
%WRITE - Routine Utility
Version 5 of MicroMUMPS allows for the wildcard option to be used
for the ZFETCH command, but does not allow it to be used for the
ZWRITE command. %WRITE was written to rectify this ommission. It
will print out a routine directory and then ask for the routine
name to ZWRITE. The user may enter a single routine name or use
the wildcard option. The routine name should be entered without
the quotation marks.
TO RUN %WRITE:
>D ^%WRITE
%COPY %DATE %DIR %DUMP %EDIT %EDITH
GBPROG1 GBPROG2 GBPROG3 GBPROG4 GBPROG5 GBPROG6
assembly language ***
ZCTEST ***
ENTER NAME OF ROUTINE TO ZWRITE([CHAR]*[CHAR]) FOR MULTIPLE FILES
[<RET> to quit) ?
{the computer will respond with a message for every routines that
meets the criteria for zwriting as follows:
WRITING routinename
>
- 11 -
%ZFN Mathematical Functions Utility
Although MUMPS is not ideally suited to mathematical calcula-
tions, a need often exists for simple functions to be incorporat-
ed in other routines. %ZFN was written to provide a number of
mathematical functions commonly found in other languages. The
functions available are:
LN %LN is returned as the natural logarithm of %X
EXP %E is returned as the exponent of %X
PWR %P is returned as the value of %X to the %Y power
SIN %Y is returned as the sine of %X(in radians)
COS %Y is returned as the cosine of %X(in radians)
DTR %X is converted from degrees to radians
RTD %X is converted from radians to degrees
SQRT %Y is returned as the square root of %X
These functions are not rapid in MicroMUMPS, but they work.
Note that the new ZMATH functions permit rapid calculation of
square root, exponent and power functions. These routines are re-
tained in %ZFN only to retain completeness in this routine.
- 12 -