Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples
Left Hand Pointer

HANG

M[UMPS] by Example

Right Hand Pointer

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

Note: The amount of seconds to be specified may be a fractional number. Many operating environments (especially those running on UnixTM platforms) do not support fractional seconds. This is a limitation of the operating environment, not a limitation of M[UMPS]. For portability, therefore, one cannot rely on the ability to use fractional numbers in this context.

Write DATA
Hang 15
Write $Char(5)
Read RESPONSE#1::1
If RESPONSE=$Char(6) Quit "OK"
If RESPONSE=$Char(21) Quit "NAK received"
Quit "Device timed out"

Check that a device responds according to protocol within defined timing constraints.

Note: In general it is not a good idea to use
If ERROR Write ERRORMSG Hang 20
Write # ; Clears screen
Quit

This example will give the user 20 seconds to read the error message, but it is better to use
If ERROR Do
. Write ERRORMSG
. Write !,"Press <return> to continue: "
. Read DUMMY:20
. Quit
Write # ; Clears screen
Quit

In this case, the user can clear the screen when he/she has read the message, and does not have to wait until the full 20 seconds have passed. Of course, if the error message is important enough, one may wish to leave out the time-out altogether.

Examples with naked references:

Hang DELTATIME
Set ^ABC(1,2)="reset naked indicator"
; naked indicator is now ^ABC(1,
Hang ^(3,4)

; naked indicator is now: ^ABC(1,3,
; Actual reference is: ^ABC(1,3,4)

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-2017 MUMPS Development Committee;
Copyright © Examples: 1995-2017 Ed de Moel;
Copyright © Annotations: 2003-2017 Jacquard Systems Research.

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 12-Sep-2014, 09:12:01 .

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