home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / b037_1 / !MUMPS_UserDoc_Speak < prev    next >
Encoding:
Text File  |  1992-12-29  |  6.5 KB  |  166 lines

  1.  
  2. Archimedes MUMPS v1.0 documentation
  3.  
  4.  
  5. MUMPS TERMINOLOGY
  6.  
  7. This chapter contains various remarks, definitions, clarifications etc.
  8.  
  9.  
  10. -  DEVICE
  11.         A device to MUMPS can be the console, a serial port, a file on the
  12.         host's filing system etc. Using the OPEN, USE and CLOSE
  13.         commands it is possible to use different devices (for
  14.         instance, %GS opens a file-device for writing it's output
  15.         to a file.) Different devices can have different device-parameters.
  16.         Parameters specified are 'tied' to the devices, NOT to the partition
  17.         specifying the device characteristics.
  18.  
  19.         Devices defined in MUMPS are:
  20.  
  21.         device  0 is not a real device, selecting device 0 selects the
  22.                 partitions principle device.
  23.  
  24.         devices 1-9 are files on the Host Filing System
  25.                 Parameters: - A file name (string)
  26.                             - open mode ["R","W" or "RW"] (lowercase allowed)
  27.  
  28.         device  10 is the Console
  29.                 Parameters: - Bits to set in VDU register of device (integer)
  30.                             - Bits to clear in VDU register (integer)
  31.  
  32.                 Defined bits for a VDU register:
  33.                 0 - output_disabled if set
  34.                 1 - do not echo input characters if set
  35.  
  36.                 Bits are set before theyare cleared !
  37.                 EXAMPLE: O 10:(2:1) sets bit 1 and clears bit 0.
  38.  
  39.         devices 11-19 are standard printer devices
  40.  
  41.         device  20 is the NULL device (output is lost, input not received)
  42.  
  43.         device  21-29 are serial devices
  44.                 Parameters: - line speed (integer)
  45.                             - #data bits (integer)
  46.                             - parity [NO=0,ODD=1,EVEN=2]
  47.                             - Bits to set in VDU register of device (integer)
  48.                             - Bits to clear in VDU register (integer)
  49.  
  50.  
  51. - ENTRY REFERENCE
  52.         Either ^<routine reference> or <line reference>^<routine reference>
  53.         or <line reference>
  54.         Examples:
  55.         DISPL^UTILS         ; The label DISPL in routine UTILS
  56.         @LINE+1^@ROU        ; Label and routine indirection
  57.         ^MAIN               ; The routine MAIN
  58.         END                 ; The label END in the current routine
  59.  
  60.  
  61. -FORMAT
  62.         <format>::=[!|#]*?<integer expression>
  63.         Format is used in the READ and WRITE commands.
  64.         Outputting a '!' means outputting a 'new line' and does:
  65.         $X=0,$Y=$Y+1 ($X and $Y meaning the current device's x- and
  66.         y-coordinate).
  67.         Outputting a '#' means outputting a 'new page' and does:
  68.         $X=0,$Y=0.
  69.         Outputting '?<n>' means outputting spaces while $X<n.    
  70.  
  71.  
  72.  - GLOBAL
  73.         It is common to refer to elements from the database (e.g. variables
  74.         stored on disk) as "global variables" as opposed to local variables
  75.         that are kept local to a partition.
  76.  
  77.  
  78. - INDIRECTION
  79.         Indirection is a very powerful feature of standard MUMPS which can
  80.         be used almost everywhere in MUMPS. What it essentially means is
  81.         that evaluation/execution is not applied to the literal
  82.         routine text, but to the string that results after evaluation
  83.         of the indirection. This doesn't make it very clear, I think. An
  84.         example.
  85.  
  86.         Suppose the local variable A="B+1" and B=19. WRITE @A will produce
  87.         the value 20, the value of B+1, not A! So a string is evaluated and
  88.         that is evaluated again to produce the value of that string as
  89.         an expression. This is indirection in expressions.
  90.  
  91.         Another example:
  92.         S A="B=10" S @A
  93.         will give B the value 10. This is argument indirection, again a
  94.         string is evaluated, but his time it is interpreted as an argument
  95.         to the SET command!
  96.  
  97.  
  98. - LINE REFERENCE
  99.         Just a label or an indirected <line reference> (= @<expression atom>
  100.         evaluating to a label (possibly indirected again!)), possibly
  101.         followed by: +<integer expression>.
  102.         Examples:
  103.         COUNT+1
  104.         @LINE+2
  105.  
  106.  
  107. - NAKED INDICATOR
  108.         Any access to a global variable with subscripts (say:
  109.         ^NAME(s1,s2,...,sn)
  110.         sets the naked indicator to:
  111.         ^NAME(s1,s2,...s(n-1))
  112.         The naked indicator can be used in referencing globals, by leaving
  113.         out the globalname and specifying only the n'ths argument, i.e.
  114.         ^(sn) is 'expanded' by MUMPS to: ^NAME(s1,s2,...,s(n-1),sn).
  115.         Example:
  116.         S ^A(10,"HUIB")="Hi there!" W ^("HUIB)
  117.         prints "Hi there!", because ^("HUIB") refers to ^A(10,"HUIB").
  118.  
  119.  
  120. - PARTITION
  121.         A partition is a area of memory reserved for just one 'user' of
  122.         MUMPS. The 'user' can be a real user or a job initiated via the JOB
  123.         command. Each partition has it's own local variables, it's own $T
  124.         boolean, it's own naked indicator, it's own list of open devices,
  125.         it's own execution stack, it's own copy of a routine etc. MUMPS
  126.         supports more than one JOB and thus more than one partition.
  127.  
  128.  
  129. - POSTCONDITION
  130.         A postcondition is a ':' followed by an expression placed after a
  131.         command or a commandargument. If the expression evaluates to true
  132.         the command or argument is executed, otherwise the command or
  133.         argument is not executed. Postconditions do not affect the $T
  134.         boolean.
  135.  
  136.  
  137. - PRINCIPLE DEVICE
  138.         Every JOB has a principle device, that is the default io-channel for
  139.         that JOB. For instance, when you first start MUMPS, it will wait
  140.         for a login on the console (device 10), when you log in a JOB will
  141.         be started that has the console as it's principle device.
  142.  
  143.  
  144. - ROUTINE REFERENCE
  145.         Just a name of a routine or an indirected <routine reference>. That
  146.         is: @<expression atom> that evaluates to a <routine reference>.
  147.         Examples:
  148.         MAIN
  149.         @ROU
  150.  
  151.  
  152. - TIMEOUT
  153.         Timeouts can be used in the OPEN, LOCK, READ commands. A timeout
  154.         looks like this: ":<numeric expression>". It specifies the time (in
  155.         seconds for MUMPS) to wait for completion of an argument. Of
  156.         course, if an argument execution can be completed before a timeout,
  157.         it will. Timeouts make sure that processes do not have wait
  158.         indefinitely for the command to finish. If a timeout of 0 is
  159.         specified, MUMPS tests to see if it possible to execute the
  160.         argument, if so, it executes and sets $T to 1, otherwise it sets $T
  161.         to 0. If a timeout>0 is specified and after timeout seconds the
  162.         argument still isn't executed, $T is set to 0. Otherwise (argument
  163.         is executed) $T is set to 1.
  164.  
  165. /* end of Speak */
  166.