☜ | HANGM[UMPS] by Example | ☞ |
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)
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 15-Nov-2023, 14:43:20.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)