Difference between revisions of "M/M Language Elements"

From VistApedia
Jump to: navigation, search
(Introduction)
Line 10: Line 10:
 
  Unless otherwise stated, most commands are followed by a space and more information needed to complete the command action. This extra information is a command argument. Most commands that have NO argument will take a default action. The commands that have no extra information are called <u>argumentless</u> commands.
 
  Unless otherwise stated, most commands are followed by a space and more information needed to complete the command action. This extra information is a command argument. Most commands that have NO argument will take a default action. The commands that have no extra information are called <u>argumentless</u> commands.
  
{{:M/Command_A}}
+
{{:M/Command_A}} {{:M/Command_B}} {{:M/Command_C}} {{:M/Command_D}}
{{:M/Command_B}}
+
{{:M/Command_E}} {{:M/Command_F}} {{:M/Command_G}} {{:M/Command_H}}
{{:M/Command_C}}
+
{{:M/Command_I}} {{:M/Command_J}} {{:M/Command_K}} {{:M/Command_L}}
{{:M/Command_D}}
+
{{:M/Command_M}} {{:M/Command_N}} {{:M/Command_O}} {{:M/Command_P}}
{{:M/Command_E}}
+
{{:M/Command_Q}} {{:M/Command_R}} {{:M/Command_S}} {{:M/Command_T}}
{{:M/Command_F}}
+
{{:M/Command_U}} {{:M/Command_V}} {{:M/Command_W}} {{:M/Command_X}}
{{:M/Command_G}}
+
{{:M/Command_Y}} {{:M/Command_Z}}
{{:M/Command_H}}
 
{{:M/Command_I}}
 
{{:M/Command_J}}
 
{{:M/Command_K}}
 
{{:M/Command_L}}
 
{{:M/Command_M}}
 
{{:M/Command_N}}
 
{{:M/Command_O}}
 
{{:M/Command_P}}
 
{{:M/Command_Q}}
 
{{:M/Command_R}}
 
{{:M/Command_S}}
 
{{:M/Command_T}}
 
{{:M/Command_U}}
 
{{:M/Command_V}}
 
{{:M/Command_W}}
 
{{:M/Command_X}}
 
{{:M/Command_Y}}
 
{{:M/Command_Z}}
 
  
 
== Operators - note: use punctuation in parentheses, not operator name ==
 
== Operators - note: use punctuation in parentheses, not operator name ==
{{:M/Operator_plus|plus <nowiki>(+)</nowiki>}}
+
{| border=1
{{:M/Operator_minus|minus <nowiki>(-)</nowiki>}}
+
|+
{{:M/Operator_times|times <nowiki>(*)</nowiki>}}
+
| {{:M/Operator_plus|plus || <nowiki>(+)</nowiki>}}
{{:M/Operator_divided_by|divided by <nowiki>(/)</nowiki>}}
+
|+
{{:M/Operator_integer_divided_by|integer divided by <nowiki>(\)</nowiki>}}
+
| {{:M/Operator_minus|minus || <nowiki>(-)</nowiki>}}
{{:M/Operator_modulo|modulo <nowiki>(#)</nowiki>}}
+
|+
{{:M/Operator_to_the_power_of|to the power of <nowiki>(**)</nowiki>}}
+
| {{:M/Operator_times|times || <nowiki>(*)</nowiki>}}
{{:M/Operator_concatenate|concatenate <nowiki>(_)</nowiki>}}
+
|+
{{:M/Operator_becomes|_becomes <nowiki>(=)</nowiki>}}
+
| {{:M/Operator_divided_by|divided by || <nowiki>(/)</nowiki>}}
{{:M/Operator_is_equal_to|is equal to <nowiki>(=)</nowiki>}}
+
|+
{{:M/Operator_object_is_equal_to|object is equal to <nowiki>(==)</nowiki>}}
+
| {{:M/Operator_integer_divided_by|integer divided by || <nowiki>(\)</nowiki>}}
{{:M/Operator_is_greater_than|is greater than <nowiki>(&gt;)</nowiki>}}
+
|+
{{:M/Operator_is_less_than|is less than <nowiki>(&lt;)</nowiki>}}
+
| {{:M/Operator_modulo|modulo || <nowiki>(#)</nowiki>}}
{{:M/Operator_is_less_than_or_equal_to|is less than or equal to <nowiki>('&gt;, &lt;=)</nowiki>}}
+
|+
{{:M/Operator_is_greater_than_or_equal_to|is greater than or equal to <nowiki>('&lt;, &gt;=)</nowiki>}}
+
| {{:M/Operator_to_the_power_of|to the power of || <nowiki>(**)</nowiki>}}
{{:M/Operator_matches_pattern|matches pattern <nowiki>(?)</nowiki>}}
+
|+
{{:M/Operator_contains|contains <nowiki>([)</nowiki>}}
+
| {{:M/Operator_concatenate|concatenate || <nowiki>(_)</nowiki>}}
{{:M/Operator_follows|follows <nowiki>(])</nowiki>}}
+
|+
{{:M/Operator_follows or is equal to|follows or is equal to <nowiki>(]=)</nowiki>}}
+
| {{:M/Operator_equals|_equals || <nowiki>(=)</nowiki>}}
{{:M/Operator_collates after|collates after <nowiki>(]])</nowiki>}}
+
|+
{{:M/Operator_collates after or is equal to|collates after or is equal to <nowiki>(]]=)</nowiki>}}
+
| {{:M/Operator_is_equal_to|is equal to || <nowiki>(=)</nowiki>}}
{{:M/Operator_and|and <nowiki>(&amp;)</nowiki>}}
+
|+
{{:M/Operator_or|or <nowiki>(!)</nowiki>}}
+
| {{:M/Operator_object_is_equal_to|object is equal to || <nowiki>(==)</nowiki>}}
{{:M/Operator_exclusive_or|exclusive or <nowiki>(!!)</nowiki>}}
+
|+
{{:M/Operator_not|not <nowiki>(')</nowiki>}}
+
| {{:M/Operator_is_greater_than|is greater than || <nowiki>(&gt;)</nowiki>}}
{{:M/Operator_indirect|indirect <nowiki>(@)</nowiki>}}
+
|+
 
+
| {{:M/Operator_is_less_than|is less than || <nowiki>(&lt;)</nowiki>}}
 +
|+
 +
| {{:M/Operator_is_less_than_or_equal_to|is less than or equal to || <nowiki>('&gt;, &lt;=)</nowiki>}}
 +
|+
 +
| {{:M/Operator_is_greater_than_or_equal_to|is greater than or equal to || <nowiki>('&lt;, &gt;=)</nowiki>}}
 +
|+
 +
| {{:M/Operator_matches_pattern|matches pattern || <nowiki>(?)</nowiki>}}
 +
|+
 +
| {{:M/Operator_contains|contains || <nowiki>([)</nowiki>}}
 +
|+
 +
| {{:M/Operator_follows|follows || <nowiki>(])</nowiki>}}
 +
|+
 +
| {{:M/Operator_follows or is equal to|follows or is equal to || <nowiki>(]=)</nowiki>}}
 +
|+
 +
| {{:M/Operator_collates after|collates after || <nowiki>(]])</nowiki>}}
 +
|+
 +
| {{:M/Operator_collates after or is equal to|collates after or is equal to || <nowiki>(]]=)</nowiki>}}
 +
|+
 +
| {{:M/Operator_and|and || <nowiki>(&amp;)</nowiki>}}
 +
|+
 +
| {{:M/Operator_or|or || <nowiki>(!)</nowiki>}}
 +
|+
 +
| {{:M/Operator_exclusive_or|exclusive or || <nowiki>(!!)</nowiki>}}
 +
|+
 +
| {{:M/Operator_not|not || <nowiki>(')</nowiki>}}
 +
|+
 +
| {{:M/Operator_indirect|indirect || <nowiki>(@)</nowiki>}}
 +
|+
 +
|
 +
|}
 
== (Intrinsic) Special_Variables svn ==
 
== (Intrinsic) Special_Variables svn ==
{{:M/Special_Variable_A}}
+
{{:M/Special_Variable_A}} {{:M/Special_Variable_B}} {{:M/Special_Variable_C}} {{:M/Special_Variable_D}}
{{:M/Special_Variable_B}}
+
{{:M/Special_Variable_E}} {{:M/Special_Variable_F}} {{:M/Special_Variable_G}} {{:M/Special_Variable_H}}
{{:M/Special_Variable_C}}
+
{{:M/Special_Variable_I}} {{:M/Special_Variable_J}} {{:M/Special_Variable_K}} {{:M/Special_Variable_L}}
{{:M/Special_Variable_D}}
+
{{:M/Special_Variable_M}} {{:M/Special_Variable_N}} {{:M/Special_Variable_O}} {{:M/Special_Variable_P}}
{{:M/Special_Variable_E}}
+
{{:M/Special_Variable_Q}} {{:M/Special_Variable_R}} {{:M/Special_Variable_S}} {{:M/Special_Variable_T}}
{{:M/Special_Variable_F}}
+
{{:M/Special_Variable_U}} {{:M/Special_Variable_V}} {{:M/Special_Variable_W}} {{:M/Special_Variable_X}}
{{:M/Special_Variable_G}}
+
{{:M/Special_Variable_Y}} {{:M/Special_Variable_Z}}
{{:M/Special_Variable_H}}
 
{{:M/Special_Variable_I}}
 
{{:M/Special_Variable_J}}
 
{{:M/Special_Variable_K}}
 
{{:M/Special_Variable_L}}
 
{{:M/Special_Variable_M}}
 
{{:M/Special_Variable_N}}
 
{{:M/Special_Variable_O}}
 
{{:M/Special_Variable_P}}
 
{{:M/Special_Variable_Q}}
 
{{:M/Special_Variable_R}}
 
{{:M/Special_Variable_S}}
 
{{:M/Special_Variable_T}}
 
{{:M/Special_Variable_U}}
 
{{:M/Special_Variable_V}}
 
{{:M/Special_Variable_W}}
 
{{:M/Special_Variable_X}}
 
{{:M/Special_Variable_Y}}
 
{{:M/Special_Variable_Z}}
 
  
 
== Functions ==
 
== Functions ==
{{:M/Function_A}}
+
{{:M/Function_A}} {{:M/Function_B}} {{:M/Function_C}} {{:M/Function_D}}
{{:M/Function_B}}
+
{{:M/Function_E}} {{:M/Function_F}} {{:M/Function_G}} {{:M/Function_H}}
{{:M/Function_C}}
+
{{:M/Function_I}} {{:M/Function_J}} {{:M/Function_K}} {{:M/Function_L}}
{{:M/Function_D}}
+
{{:M/Function_M}} {{:M/Function_N}} {{:M/Function_O}} {{:M/Function_P}}
{{:M/Function_E}}
+
{{:M/Function_Q}} {{:M/Function_R}} {{:M/Function_S}} {{:M/Function_T}}
{{:M/Function_F}}
+
{{:M/Function_U}} {{:M/Function_V}} {{:M/Function_W}} {{:M/Function_X}}
{{:M/Function_G}}
+
{{:M/Function_Y}} {{:M/Function_Z}}
{{:M/Function_H}}
 
{{:M/Function_I}}
 
{{:M/Function_J}}
 
{{:M/Function_K}}
 
{{:M/Function_L}}
 
{{:M/Function_M}}
 
{{:M/Function_N}}
 
{{:M/Function_O}}
 
{{:M/Function_P}}
 
{{:M/Function_Q}}
 
{{:M/Function_R}}
 
{{:M/Function_S}}
 
{{:M/Function_T}}
 
{{:M/Function_U}}
 
{{:M/Function_V}}
 
{{:M/Function_W}}
 
{{:M/Function_X}}
 
{{:M/Function_Y}}
 
{{:M/Function_Z}}
 

Revision as of 17:16, 8 February 2021

Introduction

The M Computer Language (sometimes called MUMPS) has abbreviations for each command. We will have sections in this page for each character of the alphabet. This information is from Ed de Moel's MUMPS by Example web page.

Unless otherwise stated, all commands on this page are part of the Standard M Language and are implemented by all Standard M vendors. Any commands that are not implemented by all Standard M vendors are not used by VistA application code.

Commands

Unless otherwise stated, each command may be followed by the colon (:), then a postcondition which is an expression that when evaluated is interpreted as either True (1) or False (0). When the postcondition is interpreted as True, the command is executed with its arguments. When the postcondition is interpreted as False then the command is NOT executed with its arguments and is skipped. The postcondition functions as a "guard" that either allows the command to be executed or not.
Unless otherwise stated, most commands are followed by a space and more information needed to complete the command action. This extra information is a command argument. Most commands that have NO argument will take a default action. The commands that have no extra information are called argumentless commands.
   ↑ M Language Elements ↑  |  → Command B → 

command A or a

 Currently, the letter sequence A is the prefix for several commands: 

ASSIGN or assign or a or A

Currently, the letter sequence A is the abbreviation for the Command ASSIGN. This Command is part of the next M Standard.
This command is not implemented by all vendors.

ABLOCK or ablock or ab or AB

 Currently, the letter sequence AB is the abbreviation for the Command ABLOCK. This Command is part of the next M Standard.
This command is not implemented by all vendors. 

ASTART or astart or asta or ASTA

 Currently, the letter sequence ASTA is the abbreviation for the Command ASTART. This Command is part of the next M Standard.
This command is not implemented by all vendors.

ASTOP or astop or asto or ASTO

 Currently, the letter sequence ASTO is the abbreviation for the Command ASTOP. This Command is part of the next M Standard.
This command is not implemented by all vendors.

AUNBLOCK or aunblock or aunb or AUNB

 Currently, the letter sequence AUNB is the abbreviation for the Command AUNBLOCK. This Command is part of the next M Standard.
This command is not implemented by all vendors.
=== Former Non-Standard Command ===
The letter A used to be the abbreviation for the Command ASK.  No Standard M implementation is required to implement this command. Non-Standard M systems may include the Command ASK.
  ← Command A ←  |  ↑ M Language Elements ↑  |  → Command C → 

command B or b

 Currently, the letter B is the abbreviation for the Command BREAK.  

command C or c

 Currently, the letter C is the abbreviation for the Command CLOSE.  

command D or d

 Currently, the letter D is the abbreviation for the Command DO. 

command E or e

 Currently, the letter sequence E is the prefix for several commands: 

ELSE or else or e or E

Currently, the letter sequence E is the abbreviation for the Command ELSE.

ESTART or estart or esta or ESTA

 Currently, the letter sequence ESTA is the abbreviation for the Command ESTART. This Command is part of the next M Standard.
This is part of the MUMPS Windowing Application Programmer Interface, and may not be implemented by all vendors. This command is not implemented by all vendors.

ESTOP or estop or esto or ESTO

 Currently, the letter sequence ESTO is the abbreviation for the Command ESTOP. This Command is part of the next M Standard.
This is part of the MUMPS Windowing Application Programmer Interface, and may not be implemented by all vendors. This command is not implemented by all vendors.

ETRIGGER or etrigger or etri or ETRI

 Currently, the letter sequence ETRI is the abbreviation for the Command ETRIGGER. This Command is part of the next M Standard.
This is part of the MUMPS Windowing Application Programmer Interface, and may not be implemented by all vendors. This command is not implemented by all vendors. 

command F or f

FOR or for or f or F

Currently, the letter sequence F is the abbreviation for the Command FOR. 

command G or g

 Currently, the letter G is the abbreviation for the Command GOTO.  

command H or h

 Currently, the letter sequence H is the prefix for several commands: 

HALT or halt or h or H

Currently, the letter sequence H is the abbreviation for the Command HALT.

HANG or hang or h or H

Currently, the letter sequence H is the abbreviation for the Command HANG.

command I or i

 Currently, the letter I is the abbreviation for the Command IF. 

IF or if or i or I

Currently, the letter sequence I is the abbreviation for the Command IF. 

command J or j

 Currently, the letter J is the abbreviation for the Command JOB. 

JOB or job or j or J

Currently, the letter sequence J is the abbreviation for the Command JOB.

The JOB command allows a programmer to specify another M job should be initiated.

command K or k

 Currently, the letter sequence K is the prefix for several commands: 

KILL or kill or k or K

Currently, the letter sequence K is the abbreviation for the Command KILL.
M/Command KSUBSCRIPTS
M/Command KVALUE 

command L or l

 Currently, the letter L is the abbreviation for the Command LOCK. 

LOCK or lock or l or L

Currently, the letter sequence L is the abbreviation for the Command LOCK.

command M or m

 Currently, the letter M is the abbreviation for the Command MERGE. 

MERGE or merge or m or M

Currently, the letter sequence M is the abbreviation for the Command MERGE. 

command N or n

 Currently, the letter N is the abbreviation for the Command NEW. 

NEW or new or n or N

Currently, the letter sequence N is the abbreviation for the Command NEW. 

command N or n

 Currently, the letter O is the abbreviation for the Command OPEN. 

OPEN or open or o or O

Currently, the letter sequence O is the abbreviation for the Command OPEN. 

command P or p

There are no commands in the M language that start with the letter P.

command Q or q

 Currently, the letter Q is the abbreviation for the Command QUIT. 

QUIT or quit or q or Q

Currently, the letter sequence Q is the abbreviation for the Command QUIT. 

command R or r

 Currently, the letter sequence R is the prefix for several commands: 

READ or read or r or R

Currently, the letter sequence R is the abbreviation for the Command READ.
M/Command RSAVE
M/Command RLOAD 

command S or s

 Currently, the letter S is the abbreviation for the Command SET. 
M/Command SET 

command T or t

 Currently, the letter sequence T is the prefix for several commands: 
M/Command TCOMMIT
M/Command TRESTART
M/Command TROLLBACK
M/Command TSTART

command U or u

 Currently, the letter U is the abbreviation for the Command USE. 
M/Command USE 

command V or v

 Currently, the letter V is the abbreviation for the Command VIEW. 

VIEW or V or view or v command

Currently, the letter sequence V is the abbreviation for the Command VIEW.
As per the M Standard all  are defined by an implementation from a Template:M/vendor.
 

command W or w

 Currently, the letter W is the abbreviation for the Command WRITE. 

  1. REDIRECTM/WRITE

command X or x

 Currently, the letter X is the abbreviation for the Command XECUTE.

command Y or y

There are no commands in the M language that start with the letter Y. 

command Z or z

There are no commands in the M language that start with the letter Z.
all commands that start with Z are considered to be at the implementation's choice.
 Currently, the letter sequence Z is the prefix for several commands: 
M/Command ZCOMMAND

Operators - note: use punctuation in parentheses, not operator name

M/Operator plus
M/Operator minus
M/Operator times
M/Operator divided by
M/Operator integer divided by
M/Operator modulo
M/Operator to the power of
M/Operator concatenate
M/Operator equals
M/Operator is equal to
M/Operator object is equal to
M/Operator is greater than
M/Operator is less than
M/Operator is less than or equal to
M/Operator is greater than or equal to
M/Operator matches pattern
M/Operator contains
M/Operator follows
M/Operator follows or is equal to
M/Operator collates after
M/Operator collates after or is equal to
M/Operator and
M/Operator or
M/Operator exclusive or
M/Operator not
M/Operator indirect

(Intrinsic) Special_Variables svn

M/Special Variable A M/Special Variable B M/Special Variable C M/Special Variable D
M/Special Variable E M/Special Variable F M/Special Variable G M/Special Variable H
M/Special Variable I M/Special Variable J M/Special Variable K M/Special Variable L
M/Special Variable M M/Special Variable N M/Special Variable O M/Special Variable P
M/Special Variable Q M/Special Variable R M/Special Variable S M/Special Variable T
M/Special Variable U M/Special Variable V M/Special Variable W M/Special Variable X
M/Special Variable Y M/Special Variable Z

Functions

M/Function A M/Function B M/Function C M/Function D
M/Function E M/Function F M/Function G M/Function H
M/Function I M/Function J M/Function K M/Function L
M/Function M M/Function N M/Function O M/Function P
M/Function Q M/Function R M/Function S M/Function T
M/Function U M/Function V M/Function W M/Function X
M/Function Y M/Function Z