home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / mumps / utility.doc < prev    next >
Text File  |  1989-03-06  |  25KB  |  860 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                            MICROMUMPS
  10.  
  11.  
  12.  
  13.                         UTILITY ROUTINES
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                   Division of Computer Science
  20.                     University of California
  21.                          Davis, CA 95616
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                          December, 1986
  31.  
  32.                        (updated March 1989)  
  33.                           (version 5.2 ) 
  34.                           (marked '***')
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.               SETMUMPS -- Interpreter Configuration
  67.  
  68. SETMUMPS is an assembly language utility that allows you  to  re-
  69. configure a MUMPS system.  The parameters that can be modified are
  70. the partition size (which indirectly determines the space available
  71. for routine and global buffers), default drive assignments for I/O  ***
  72. and error message files, default drive, path (subdirectory) and 
  73. name assignment for the routine library and global file, substitu-  ***
  74. tion of another error message file (e.g., for foreign language 
  75. messages), modification (or setting) of the clear screen string so 
  76. that W # will work properly, the facility for an auto-execute mode,
  77. and the ability to disable control-C and control-G interrupts.  To
  78. use, type SETMUMPS and follow the instructions as  shown  in  the
  79. dialogs below.  You will be given options to change each parameter
  80. listed, with the current value also provided.  Typing  <return> 
  81. in response to any question will skip to the next question.  When 
  82. entering the clear screen string characters, type an 'H' or 'h' 
  83. after the hexadecimal character, otherwise it's assumed to be decimal.  
  84. The default drives can be any letter from 'A' to 'P', corresponding  
  85. to drives A to P, or '*'.  Selection of '*' as a drive allows the 
  86. default drive to be determined at run time, where the choice will 
  87. be the current system drive.  The `default I/O drive' referred to 
  88. below relates to .MMP routines existing outside  the  MUMPS  environ-
  89. ment.  For example, to copy any MUMPS routines from versions prior 
  90. to 5.0, the disk drive containing those routines would be specified
  91. by the default I/O drive.  When auto-execute mode is used, the MUMPS  
  92. interpreter automatically starts executing a predetermined routine 
  93. sequence.  Auto-execute mode is set up by typing 'Y' to the auto-
  94. execute question.  Any time control would return to direct mode, 
  95. an exit is made to the operating system instead, isolating the user  
  96. entirely from the MUMPS  environment.   The following examples 
  97. illustrate different responses to SETMUMPS prompts:
  98.  
  99. A:\>setmumps<RET>
  100.  
  101. MUMPS 8086/88 version 4.9 setup utility July 1988  [version number may vary]
  102.  
  103. Enter drive of the MUMPS to change: b<RET>
  104. Enter partition size in bytes (8192): 6000<RET>
  105. That leaves 52951 bytes for routine and global buffers
  106. Is that enough room (Y/N)? y<RET>
  107. Enter default global drive -- A-P,* -- (A): b<RET>
  108. Do you want to change the global file name? (Y/N) y<RET>             ***
  109. Enter name for new global file name: mumps\newglob<RET>              ***
  110.   [NOTE: Do NOT enter drive designation or '.DAT']                   ***
  111. Enter default I/O drive --A-P,* -- (A): b<RET>
  112. Currently the routine-file pathname is: ROUTINES.RTN                 ***
  113. Do you want to change it (Y/N) n<RET>
  114. Enter default error message drive -- A-P,* -- (A): <RET>
  115. Do you want to change the error message file name? (Y/N) n<RET>
  116. Currently the clear screen string is (decimal) -- 27 91 50 74
  117.                                  (hexadecimal) -- 1B 5B 32 4A
  118. Do you want to change it? (Y/N) n<RET>
  119. Currently the auto-execute command is undefined
  120. Do you want to change it? (Y/N) n<RET>
  121. Control-C breaking is currently enabled
  122. Do you want to change it? (Y/N) n<RET>
  123. Control-G talk-through is currently disabled
  124. Do you want to change it? (Y/N) n<RET>
  125.  
  126. The MUMPS standard specifies 9 significant digits for numeric representation
  127. You may change it with the range of 1 to 14 digits.
  128. Enter number of significant digits (9): <RET>
  129.  
  130. The new configuration of MUMPS is saved
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. A:\>setmumps<RET>
  139.  
  140. MUMPS 8086/88 version 4.9 setup utility July 1988
  141.  
  142. Enter drive of the MUMPS to change: a<RET>
  143. Enter partition size in bytes (6000): 8192<RET>
  144. That leaves 52951 bytes for routine and global buffers
  145.  
  146. Is that enough room (Y/N)? y<RET>
  147. Enter default global drive -- A-P,* -- (A): a<RET>
  148. Do you want to change the global file name? (Y/N) n<RET>             ***
  149. Enter default I/O drive --A-P,* -- (A): a<RET>     [for .MMP files]
  150. Currently the routine-file pathname is: ROUTINES.RTN                 ***
  151. Do you want to change it (Y/N) y<RET>
  152. Enter new pathname (40 max): B:\FMGR\ROUTINES.DAT<RET>
  153.    [NOTE: You MAY enter drive designation and you MUST enter both    ***
  154.           the filename and the three character extension]            ***
  155. Enter default error message drive -- A-P,* -- (A): <RET>
  156. Do you want to change the error message file name? (Y/N) <RET>
  157. Currently the clear screen string is (decimal) -- 27 91 50 74
  158.                                  (hexadecimal) -- 1B 5B 32 4A
  159. Do you want to change it? (Y/N) <RET>
  160. Currently the auto-execute command is undefined
  161. Do you want to change it? (Y/N) y<RET>
  162. Enter the MUMPS commands to auto-execute
  163.         D ^DI
  164. Control-C breaking is currently enabled
  165. Do you want to change it? (Y/N) y<RET>
  166. It's changed
  167. Control-G talk-through is currently disabled
  168. Do you want to change it? (Y/N) y<RET>
  169. It's changed
  170.  
  171. The MUMPS standard specifies 9 significant digits for numeric representation
  172. You may change it with the range of 1 to 14 digits.
  173. Enter number of significant digits (9): <RET>
  174.  
  175. The new configuration of MUMPS is saved
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                              - 2 -
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.             SETGLOB.EXE -  Global File Initialization
  206.  
  207. SETGLOB.EXE is an assembly language utility that creates an empty
  208. global file (default name is GLOBALS.DAT).  To use type 'SETGLOB.'   ***
  209. When asked for a drive, enter the letter only of the drive to put  
  210. the global file on.  SETGLOB will then ask for a file name.  The     *** 
  211. extension is assumed and will always be '.DAT'.  If the file already ***
  212. exists in that subdirectory, an error message is printed and the     ***
  213. program halts.  Note that this utility clears all globals from the 
  214. data base.  The next question is about the maximum size of the global 
  215. file in Kbytes.  (One Kbyte equal 1024 Bytes.)  This value must be   ***
  216. between 1 and 48000.  (NOTE: A 360KB floppy holds 353 Kbytes and     ***
  217. most versions of DOS have a 32,000 Byte file size limit).  A file of ***
  218. the size specified is allocated at this time, and bitmaps are created 
  219. to allow MUMPS to allocate and deallocate space within the globals 
  220. file.  The globals file will always be created in the subdirectory   ***
  221. in which SETGLOB was run.                                            ***
  222.  
  223. The distribution disk has a very small global file created.  This
  224. file  is sufficient to demonstrate MUMPS functions, but it should
  225. not be used when creating permanent data.  It certainly is nowhere   ***
  226. near large enough to run the VA FileManager routines.                ***
  227.  
  228. Errors will be generated if the user attempts to write beyond the
  229. upper  limit of the global file.  A warning is issued when only 7
  230. or so blocks are available (slightly over 5 K bytes).  It is pos-
  231. sible  to  continue writing to globals at this time, but the user
  232. should be very cautious about doing so.  It is better to purge or
  233. save the existing global so that new data can be accommodated.
  234.  
  235. SAMPLE RUN:
  236.  
  237. A:\>SETGLOB
  238.  
  239. Which drive do you want the globals on?  A<ret>
  240. Enter name for globals file or <cr> for "GLOBALS" (assumed typ is DAT): ***
  241.         >NEWGLOB<ret>                                                ***
  242. Enter the maximum size for your globals file (K-Bytes): 200 
  243.      [note: the system will write 0s in the file.  Depending on the 
  244.       size, this may take a few minutes.]
  245.  
  246. The global file is initialized.
  247.  
  248. A:\>
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.                              - 3 -
  261.  
  262.  
  263.  
  264.  
  265.  
  266.              SETROUT.EXE - Routine File Initializer
  267.  
  268. SETROUT.EXE is an object code program that initializes a  Routine
  269. Library used in Version 5.0 and later releases of UCD MicroMUMPS.
  270. Routines in these releases are stored in a  single  library  file
  271. with  a  B-Tree directory that facilitates fast searching for the
  272. routines on disk. The purpose of this program is  to  create  the
  273. initial  disk  and  set up the beginning directory table for rou-
  274. tines.
  275.  
  276. Once SETROUT has been run, routines can be loaded into this  file
  277. using the ZFETCH command described in the User Manual.
  278.  
  279. SETROUT give you the option of  establishing  a  Routine  Library
  280. under  any  name  that  you  may  select.  The  default  name  is
  281. ROUTINES.RTN, but you may define other Library files  with  other    ***
  282. names to allow grouping of routines for different applications.
  283.  
  284. The following  lines  illustrate  sample  executions  of  SETROUT
  285.  
  286. EXAMPLE 1:   A:\>setrout
  287.  
  288.              SETROUT.EXE version 1.1
  289.  
  290.              Enter pathname of desired data file: ROUTN.LIB
  291.  
  292.              FILE HAS BEEN CREATED
  293.  
  294.              terminating SETROUT.EXE
  295.  
  296.              A:\>DIR
  297.  
  298.              ROUTN   LIB     3072    12/20/86   2:54p [directory information]
  299.  
  300. EXAMPLE 2:   In this example, the user wishes to use a complete pathname:
  301.  
  302.              A:\>setrout
  303.  
  304.              SETROUT.EXE   version 1.1
  305.  
  306.              Enter pathname of desired data file : C:\APPLIC1\ROUTINES.DAT
  307.  
  308.              FILE HAS BEEN CREATED
  309.  
  310.     (Note that the path subdirectory \APPLIC1 must exist in order to
  311.     create this file.  The user can then use either SETMUMPS to de-
  312.     fault to this file or run ZOPTION as specified in the User Manual
  313.     during execution to redirect MUMPS to this file for executable
  314.     routines.)
  315.  
  316. The actual amount of space used by routines stored in  a  library
  317. is  roughly  comparable to the storage space required by the same
  318. routines in the .MMP format. However, there are two advantages to
  319. the library format. First, access to the routines is a great deal
  320. faster, because of the directory pointing to the  start  of  each
  321. routine.  Second,  the  library file uses only one Root directory
  322. entry or one file entry in a path subdirectory; hence,  directory
  323. space  is  conserved  and access to a single file will obtain all
  324. routines stored in that library.
  325.  
  326.                              - 4 -
  327.                              
  328.  
  329.  
  330.  
  331.  
  332.                     TK Communication Routines
  333.  
  334. The TK routines provide a general purpose file  transfer  utility
  335. capability between MUMPS systems. Currently, it will send and re-
  336. ceive, with full handshaking, error detection and retransmission,
  337. MUMPS  routines,  MUMPS  globals,  and  ASCII  files. Without any
  338. changes, the utility will run between two microMUMPS systems that
  339. have the auxiliary input and output ports assigned to an external
  340. serial line.  With minor changes, routine  and  global  transfers
  341. can be made with other systems (not MicroMUMPS).
  342.  
  343. Sample uses:
  344.  
  345. Following is a sample dialog for transfers between  systems  with
  346. an operator at each system:
  347.  
  348. *****to send:
  349.  
  350. >D ^TK
  351.  
  352. Are you connected to the remote system as a terminal (Y/N)? N 
  353. Do you wish to send or receive (R/S) ? S 
  354. Sending routines, globals, or ASCII files (R/G/F) ? R 
  355. Do you want outgoing data displayed (Y/N) ? N
  356.  
  357. Option -- ADD 
  358. Enter the routine name: %M 
  359. Enter the routine  name:%M0 
  360. Enter the routine name:
  361.  
  362. Option -- LIST 
  363. %M              %M0
  364.  
  365. Option --
  366.  
  367. Routine %M being sent -- Sent 
  368. Routine %M0 being sent -- Sent
  369.  
  370. Successful completion
  371.  
  372. >
  373.  
  374. ****to receive
  375.  
  376. Are you connected to the remote system as a terminal (Y/N)? N  Do
  377. you  wish  to  send of receive (R/S) ? R Receiving routines, glo-
  378. bals, or ASCII files (R/G/F) ? R Do you want  the  incoming  data
  379. displayed (Y/N) ? N
  380.  
  381. Routine %M being received -- Received Routine $M0 being  received
  382. -- Received
  383.  
  384. Successful completion
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                              - 5 -
  393.  
  394.  
  395.  
  396.  
  397.  
  398. Following is a sample dialog illustrating transfers between  sys-
  399. tems with an operator at only one of the two machines.
  400.  
  401. ****to send:
  402.  
  403. >D ^TK
  404.  
  405. Are you connected to the remote system as a terminal (Y/N)? Y  
  406. Do you wish to send or receive (R/S) ? S 
  407. Sending routines, globals or ASCII files (R/G/F) ? G 
  408. Do you want outgoing data displayed (Y/N) ? N
  409.  
  410. Option -- ADD 
  411. Enter the global name: %MU 
  412. Enter the global name: %MTC 
  413. Enter the global name:
  414.  
  415. Option -- LIST
  416. %MU             %MTC
  417.  
  418. Global %MTC being sent -- Sent 
  419. Global %MTC being sent -- Sent
  420.  
  421. Successful completion
  422.  
  423. ****to receive:
  424.  
  425. >D ^TK
  426.  
  427. Are you connected to the remote system as a terminal (Y/N) ?Y  
  428. Do you wish to send or receive (R/S) ? R 
  429. Receiving routines, globals, or ASCII files (R/G/F) ? R  
  430. Do you want incoming data displayed (Y/N) ? N
  431.  
  432. Enter routine name: VV 
  433. Enter routine name: VVAC  
  434. Enter routine name:
  435.  
  436. Routine VV being received -- Received 
  437. Routine VVAC being received -- Received
  438.  
  439. Successful completion
  440.  
  441.  
  442. Comments The first question would be answered  yes  (Y)  only  if
  443. there  is  one operator controlling the entire process, i.e., the
  444. MUMPS system is effectively acting as a terminal to another MUMPS
  445. machine.  Answering  yes (Y) to the question about displaying in-
  446. coming data will cause all data being transferred also to  appear
  447. on the screen.
  448.  
  449. When sending data, it is necessary to create a list of  the  rou-
  450. tines,  globals, or ASCII files to be transmitted. Unfortunately,
  451. the package was developed independently of the  Lewkowicz  utili-
  452. ties,  so  there  is  no connection between the selection process
  453. used in these routines and the %M routines.
  454.  
  455.  
  456.  
  457.  
  458.                              - 6 -
  459.  
  460.  
  461.  
  462.  
  463.  
  464. When transferring to an un-manned remote  system,  the  following
  465. procedure  is used. Start MicroMUMPS until the first prompt. Then
  466. type control-G to begin talk-through mode. Now your MUMPS acts as
  467. a  terminal  to  the remote system. Everything typed is displayed
  468. and sent out to the remote system. Everything  received  is  also
  469. displayed.  When  you have logged in, type control-G again to re-
  470. turn to MicroMUMPS.  Start the TK procedure described above. When
  471. the  transfer  is  complete,  log off the remote system by typing
  472. control-G, logging out, and typing control-G again to  return  to
  473. local mode.
  474.  
  475. Note: The TK routines permit use of  ``wild  card''  notation  to
  476. specify  names  of  routines, globals, or file to be transmitted.
  477. Thus, %* will transfer all names starting with %,  and  VV?  will
  478. transfer all three letter names starting with VV.
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                              - 7 -
  525.  
  526.  
  527.  
  528.  
  529.  
  530.                          %COPY - Global Utility
  531.  
  532. %COPY is a  global utility  which will copy globals in  a MicroMUMPS 
  533. environment. It uses implementation features specific to MicroMUMPS.
  534. %COPY will  allow one to copy one or more globals from a GLOBALS.DAT
  535. file on one disk to another GLOBALS.DAT file found on a second disk.
  536.  
  537. TO RUN %COPY:
  538.  
  539. >D ^%COPY
  540.  
  541. THIS ROUTINE COPIES GLOBALS FROM AN EXISTING GLOBALS.DAT FILE ON
  542. ONE DRIVE TO AN EXISTING GLOBALS.DAT FILE ON ANOTHER DRIVE.
  543.  
  544. DO YOU WANT TO CONTINUE?(DEFAULT/"NO"):
  545.  
  546. ENTER DRIVE TO READ GLOBALS FROM (A-P):a
  547.  
  548. ENTER DRIVE TO WRITE GLOBALS TO (A-P):c
  549. GLOBALS LIST:
  550.  
  551. %X 
  552.  
  553. TOTAL NUMBER OF GLOBALS IS ... 1
  554. DO YOU WISH TO STORE "%X"?(DEFAULT/"NO"):
  555.  
  556. DONE
  557. >
  558.  
  559.                       %DATE - Date Utility
  560.  
  561. Purpose: to return, from $HOROLOG internal  storage  format,  the
  562. correct date, stored in the variable %DT. This routine calculates 
  563. date from the value typed in at sign-on time in  some systems, or 
  564. the value available from the system in  implementation  where that 
  565. information is available (such as the IBM PC.)
  566.  
  567.                      %DUMP - Global Display Utility
  568.  
  569. %DUMP is a global utility which will display or print the contents 
  570. of any global in a MicroMUMPS  environment without prior knowledge
  571. of the global structure.  It uses implementation features specific
  572. to MicroMUMPS.
  573.  
  574.  
  575. TO RUN %DUMP:
  576.  
  577. >D ^%DUMP
  578.  
  579. LIST OF GLOBAL VARIABLES
  580.  
  581. %X
  582.  
  583. ENTER GLOBAL VARIABLE NAME:
  584. WOULD YOU LIKE THE OUTPUT TO GO TO THE PRINTER? /NO/:
  585.  
  586. [The computer will display the global as follows:
  587. %X(1)   xxxxxxxx
  588. %X(2)   yyyyyyyy
  589. >      
  590.                              - 8 -
  591.  
  592.  
  593.  
  594.  
  595.  
  596.                  %EDIT - General Purpose Editor
  597.  
  598. This is a general purpose editor with  relatively  simple  opera-
  599. tions.  It may be used for short fixes, expecially changing a few
  600. characters on a line. It does not contain the sophisticated docu-
  601. mentation  capability  found  in the %M routines, which should be
  602. used for applications development. We consider it a  ``quick  and
  603. dirty'' editor useful for short on-line changes.
  604.  
  605.     The program is executed first by typing:
  606.     >DO ^%EDIT
  607.  
  608. This invokes the editor and creates a global file  ^%,  which  is
  609. then used to edit a routine or global. When complete, the program
  610. types:
  611.  
  612.         THE EDITOR IS  LOADED.           EDITOR  HELPED  TEXT  IS
  613. LOADED
  614.  
  615. To execute this global file, type
  616.  
  617.         XECUTE ^%
  618.  
  619. The response from this command is a new prompt: >>, which appears
  620. as  long  as  you  are in the editor global.  To exit the editor,
  621. type a return when this prompt appears.
  622.  
  623. All commands operate on the  current ZLOADED routine.  There  are
  624. several commands that may be invoked through the editor. To enter
  625. a command type in the first letter  only  and  answer  additional
  626. prompts as indicated.
  627.  
  628. ?       Displays a summary of commands available.
  629.  
  630. B       (Backup  routine):   save  a  routine  on  drive   A   as
  631.    (name).SAV, to provide a backup version, or to use another ed-
  632.    itor.
  633.  
  634. R       (Restore routine): Restores a routine  previously  backed
  635.    up.
  636.  
  637. C       (Change):  the program then asks for the label+offset  of
  638.    the  target  line.    After you type that line identification,
  639.    the program lists the line, and asks for the string  that  you
  640.    wish  to  replace, then types the line up to that string, asks
  641.    for the replacement, and, when you type  a  return,  completes
  642.    the  line  beyond the text that you have replaced.  It repeats
  643.    this request (on the same line) until you type a  return  with
  644.    no  other  characters  in response to a REPLACE statement.  It
  645.    then returns you to the general editor for other commands.
  646.  
  647.    This option can also be used directly from the  >>  prompt  by
  648.    typing in a label with optional offset followed by one space.
  649.  
  650.    Globals may be edited using the same facilities by entering  a
  651.    full global reference at the >> prompt.
  652.  
  653. D       (Delete): asks for label+offset. Deletes that line.
  654.  
  655. I       (Insert): insert before a (label+offset) line.  When  in-
  656.    serting,  use  a  blank  (space) for linestart character. Ter-
  657.    minate insert mode with a blank line.
  658.                              - 9 -
  659.  
  660.  
  661.  
  662. L       (List): lists from label+offset to label+offset.
  663.  
  664. S       (Search For):  lists all lines in which the target string
  665.    is found, with a >below the string.
  666.  
  667. E       (Every  Occurence):   replaces  every  occurence  of  one
  668.    string  with  another in the current routine.  Note that STACK
  669.    OVERFLOW messages may appear when editting very long lines  of
  670.    code with this option.
  671.  
  672.    In addition, any direct mode command(s) may be  executed  from
  673.    the  >>  prompt,  for example, ZPRINT to print the entire rou-
  674.    tine.  Note that ZLOADing a new routine to edit must  be  per-
  675.    formed at the > prompt, not in the editor.
  676.  
  677. When you have completed the use of the editor,  you should resave
  678. your routine using the ZSAVE command.
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.                             %INDEX
  687.              Utility Cross Reference Listing Package
  688.  
  689.  
  690. This utility is a package that accepts one or more MUMPS routines
  691. and  generates  cross  reference  information  as  well as syntax
  692. checking.  The package was originally part of aa large number  of
  693. routines  that were a portion of the DOC package distributed with
  694. QUEST by the MUMPS Users' Group.  Robert  Lushene  (Veterans  Ad-
  695. ministration,  Florida)  modified  the routines to fit into a few
  696. routines that still provide the  basic  benefits  of  the  larger
  697. package.
  698.  
  699. In order to run the cross reference programs,  one should type DO
  700. ^%INDEX.  This program then asks the name of the routine(s) to be
  701. analyzed  and asks further for output options (a note of unrefer-
  702. enced  labels,  print  index,  list routines and print errors and
  703. warnings).  During execution, the program outputs  a  period  for
  704. each  line  that  it  has  processed.   At  the conclusion of the
  705. analysis of the routines, the requested output is produced on the
  706. current output device.
  707.  
  708. This package is helpful, not only in identifying the use of vari-
  709. ables  and  possible  missing referenced labels, but it also will
  710. note syntax problems encountered in programs, thereby providing a
  711. rapid  verification  of  the accuracy of programs before they are
  712. executed.
  713.  
  714. The programs use mostly  local  variables.   In  addtion,  global
  715. variables  ^XCR and ^UTILITY are used during execution and killed
  716. thereafter.
  717.  
  718.  
  719.  
  720.  
  721.  
  722.                              - 10 -
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.                               %SHOW
  732.  
  733. %SHOW is a MUMPS routine to dump out random portions of an  ASCII
  734. file.  It is also an example of some of the new features included
  735. in MicroMUMPS.  %SHOW asks for a file  name and  drive  and  then
  736. checks  to  see if the file is present. If so, a record number is
  737. requested.  By entering a number between 0 and the file size  (in
  738. 128 byte records), the file starting at that point is dumped out.
  739. Invalid record numbers are  checked  for.  Instead  of  a  record
  740. number,  a RETURN can be typed, in which case the dump will start
  741. at the sector after the previous dump. Enter Q or q to exit %SHOW.
  742.  
  743. The features found in %SHOW start on  the  second  line, %SHOW+1,
  744. where  an error trap is enabled to label ERR.  At ENTER+1, $ZR is
  745. used to save the  current  routine  drive  in  variable  DR.   At
  746. ENTER+2,  a  post-conditional on ZO may change the routine drive.
  747. The next new feature is found in the line at DSP+3, where  device
  748. 2  is to be USEd at record NS to do the random read.  At END, the
  749. routine drive may be changed back to what  it  was  on  entry  to
  750. SHOW.   The error trapping at ERR at the end uses the new form of
  751. the error trap message to  determine  if  an  error  48  (invalid
  752. parameter) occurred. If so, the record number entered was bad, in
  753. which case a message is written,  the error trap  is  re-enabled,
  754. and control is given back to the program.  Any other error causes
  755. exit of the program.
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.                           %WRITE - Routine Utility
  763.  
  764. Version 5 of MicroMUMPS allows for the wildcard option to be used 
  765. for the ZFETCH command,  but does not allow it to be used for the 
  766. ZWRITE command. %WRITE was written to rectify this ommission.  It
  767. will print  out a  routine directory and then ask for the routine
  768. name to ZWRITE.   The user may enter a single routine name or use
  769. the wildcard option.   The routine name should be entered without
  770. the quotation marks.
  771.  
  772. TO RUN %WRITE:
  773.  
  774. >D ^%WRITE
  775. %COPY    %DATE    %DIR     %DUMP    %EDIT    %EDITH
  776. GBPROG1  GBPROG2  GBPROG3  GBPROG4  GBPROG5  GBPROG6
  777. assembly language                                                    ***
  778. ZCTEST                                                               ***
  779.  
  780. ENTER NAME OF ROUTINE TO ZWRITE([CHAR]*[CHAR]) FOR MULTIPLE FILES
  781. [<RET> to quit) ?
  782. {the computer will respond with a message for every routines that 
  783. meets the criteria for zwriting as follows:
  784. WRITING routinename
  785. >
  786.  
  787.  
  788.  
  789.  
  790.  
  791.                              - 11 -
  792.  
  793.  
  794.  
  795.  
  796.                %ZFN Mathematical Functions Utility
  797.  
  798. Although MUMPS is not ideally  suited  to  mathematical  calcula-
  799. tions, a need often exists for simple functions to be incorporat-
  800. ed in other routines.  %ZFN was written to provide  a  number  of
  801. mathematical  functions  commonly  found  in other languages. The
  802. functions available are:
  803.  
  804.           LN   %LN is returned as the natural logarithm of %X
  805.  
  806.           EXP  %E is returned as the exponent of %X
  807.  
  808.           PWR  %P is returned as the value of %X to the %Y power
  809.  
  810.           SIN  %Y is returned as the sine of %X(in radians)
  811.  
  812.           COS  %Y is returned as the cosine of %X(in radians)
  813.  
  814.           DTR  %X is converted from degrees to radians
  815.  
  816.           RTD  %X is converted from radians to degrees
  817.  
  818.           SQRT %Y is returned as the square root of %X
  819.  
  820. These functions are not rapid in MicroMUMPS, but they work.
  821.  
  822. Note that the new ZMATH functions  permit  rapid  calculation  of
  823. square root, exponent and power functions. These routines are re-
  824. tained in %ZFN only to retain completeness in this routine.
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.                              - 12 -
  858.  
  859.  
  860.