Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$KEY

M[UMPS] by Example

Introduced in the 1995 ANSI M[UMPS] language standard.

The value of $Key is the string that terminated the most recent input.

After a command like Read X#20, the value of $Key is most likely to be equal to the empty string.
After a command like Read X, the value of $Key will usually be equal to $Char(13) (the enter- key). However, when input was terminated by typing a function key, the value of $Key will be equal to the string of characters that is transmitted by that function key. The most common function keys on the VT–100 and compatible terminals are:

Key Code sequence
Up arrow $Char(27,91,65)
Down arrow $Char(27,91,66)
Right arrow $Char(27,81,67)
Left arrow $Char(27,91,68)
PF1 $Char(27,80)
PF2 $Char(27,81)
PF3 $Char(27,82)
PF4 $Char(27,83)

In addition, the VT–200 terminals (and the more modern versions of that family of terminals) also offer:

Key Code sequence
Find $Char(27,91)_"1~"
Insert $Char(27,91)_"2~"
Remove $Char(27,91)_"3~"
Select $Char(27,91)_"4~"
Previous page $Char(27,91)_"5~"
Next page $Char(27,91)_"6~"
F7 $Char(27,91)_"18~"
F8 $Char(27,91)_"19~"
F9 $Char(27,91)_"20~"
F10 $Char(27,91)_"21~"
F11 $Char(27,91)_"23~"
F12 $Char(27,91)_"24~"
F13 $Char(27,91)_"25~"
F14 $Char(27,91)_"26~"
Help $Char(27,91)_"28~"
Do $Char(27,91)_"29~"
F17 $Char(27,91)_"31~"
F18 $Char(27,91)_"32~"
F19 $Char(27,91)_"33~"
F20 $Char(27,91)_"34~"

Approved for addition in a future M[UMPS] Language Standard.

The initial value of $Key is implementation-dependent. However, if the initial value of $IO is the empty string, then the initial value of $Key is also the empty string.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

The information in this page is NOT authoritative and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an authoritative definition.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 13-Sep-2014, 08:20:03.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)