home *** CD-ROM | disk | FTP | other *** search
-
- Archimedes MUMPS v1.0 documentation
-
-
- MUMPS TERMINOLOGY
-
- This chapter contains various remarks, definitions, clarifications etc.
-
-
- - DEVICE
- A device to MUMPS can be the console, a serial port, a file on the
- host's filing system etc. Using the OPEN, USE and CLOSE
- commands it is possible to use different devices (for
- instance, %GS opens a file-device for writing it's output
- to a file.) Different devices can have different device-parameters.
- Parameters specified are 'tied' to the devices, NOT to the partition
- specifying the device characteristics.
-
- Devices defined in MUMPS are:
-
- device 0 is not a real device, selecting device 0 selects the
- partitions principle device.
-
- devices 1-9 are files on the Host Filing System
- Parameters: - A file name (string)
- - open mode ["R","W" or "RW"] (lowercase allowed)
-
- device 10 is the Console
- Parameters: - Bits to set in VDU register of device (integer)
- - Bits to clear in VDU register (integer)
-
- Defined bits for a VDU register:
- 0 - output_disabled if set
- 1 - do not echo input characters if set
-
- Bits are set before theyare cleared !
- EXAMPLE: O 10:(2:1) sets bit 1 and clears bit 0.
-
- devices 11-19 are standard printer devices
-
- device 20 is the NULL device (output is lost, input not received)
-
- device 21-29 are serial devices
- Parameters: - line speed (integer)
- - #data bits (integer)
- - parity [NO=0,ODD=1,EVEN=2]
- - Bits to set in VDU register of device (integer)
- - Bits to clear in VDU register (integer)
-
-
- - ENTRY REFERENCE
- Either ^<routine reference> or <line reference>^<routine reference>
- or <line reference>
- Examples:
- DISPL^UTILS ; The label DISPL in routine UTILS
- @LINE+1^@ROU ; Label and routine indirection
- ^MAIN ; The routine MAIN
- END ; The label END in the current routine
-
-
- -FORMAT
- <format>::=[!|#]*?<integer expression>
- Format is used in the READ and WRITE commands.
- Outputting a '!' means outputting a 'new line' and does:
- $X=0,$Y=$Y+1 ($X and $Y meaning the current device's x- and
- y-coordinate).
- Outputting a '#' means outputting a 'new page' and does:
- $X=0,$Y=0.
- Outputting '?<n>' means outputting spaces while $X<n.
-
-
- - GLOBAL
- It is common to refer to elements from the database (e.g. variables
- stored on disk) as "global variables" as opposed to local variables
- that are kept local to a partition.
-
-
- - INDIRECTION
- Indirection is a very powerful feature of standard MUMPS which can
- be used almost everywhere in MUMPS. What it essentially means is
- that evaluation/execution is not applied to the literal
- routine text, but to the string that results after evaluation
- of the indirection. This doesn't make it very clear, I think. An
- example.
-
- Suppose the local variable A="B+1" and B=19. WRITE @A will produce
- the value 20, the value of B+1, not A! So a string is evaluated and
- that is evaluated again to produce the value of that string as
- an expression. This is indirection in expressions.
-
- Another example:
- S A="B=10" S @A
- will give B the value 10. This is argument indirection, again a
- string is evaluated, but his time it is interpreted as an argument
- to the SET command!
-
-
- - LINE REFERENCE
- Just a label or an indirected <line reference> (= @<expression atom>
- evaluating to a label (possibly indirected again!)), possibly
- followed by: +<integer expression>.
- Examples:
- COUNT+1
- @LINE+2
-
-
- - NAKED INDICATOR
- Any access to a global variable with subscripts (say:
- ^NAME(s1,s2,...,sn)
- sets the naked indicator to:
- ^NAME(s1,s2,...s(n-1))
- The naked indicator can be used in referencing globals, by leaving
- out the globalname and specifying only the n'ths argument, i.e.
- ^(sn) is 'expanded' by MUMPS to: ^NAME(s1,s2,...,s(n-1),sn).
- Example:
- S ^A(10,"HUIB")="Hi there!" W ^("HUIB)
- prints "Hi there!", because ^("HUIB") refers to ^A(10,"HUIB").
-
-
- - PARTITION
- A partition is a area of memory reserved for just one 'user' of
- MUMPS. The 'user' can be a real user or a job initiated via the JOB
- command. Each partition has it's own local variables, it's own $T
- boolean, it's own naked indicator, it's own list of open devices,
- it's own execution stack, it's own copy of a routine etc. MUMPS
- supports more than one JOB and thus more than one partition.
-
-
- - POSTCONDITION
- A postcondition is a ':' followed by an expression placed after a
- command or a commandargument. If the expression evaluates to true
- the command or argument is executed, otherwise the command or
- argument is not executed. Postconditions do not affect the $T
- boolean.
-
-
- - PRINCIPLE DEVICE
- Every JOB has a principle device, that is the default io-channel for
- that JOB. For instance, when you first start MUMPS, it will wait
- for a login on the console (device 10), when you log in a JOB will
- be started that has the console as it's principle device.
-
-
- - ROUTINE REFERENCE
- Just a name of a routine or an indirected <routine reference>. That
- is: @<expression atom> that evaluates to a <routine reference>.
- Examples:
- MAIN
- @ROU
-
-
- - TIMEOUT
- Timeouts can be used in the OPEN, LOCK, READ commands. A timeout
- looks like this: ":<numeric expression>". It specifies the time (in
- seconds for MUMPS) to wait for completion of an argument. Of
- course, if an argument execution can be completed before a timeout,
- it will. Timeouts make sure that processes do not have wait
- indefinitely for the command to finish. If a timeout of 0 is
- specified, MUMPS tests to see if it possible to execute the
- argument, if so, it executes and sets $T to 1, otherwise it sets $T
- to 0. If a timeout>0 is specified and after timeout seconds the
- argument still isn't executed, $T is set to 0. Otherwise (argument
- is executed) $T is set to 1.
-
- /* end of Speak */
-