1
% @(#)write_erro.mlq 13.1.1.1 (ESO-IPG) 09/01/98 12:03:53
2
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3
%.COPYRIGHT (c) 1990 European Southern Observatory
6
%.KEYWORDS MIDAS, help files, WRITE/ERROR
7
%.PURPOSE On-line help file for the command: WRITE/ERROR
8
%.VERSION 1.0 20-FEB-1986 : Creation, KB
9
%----------------------------------------------------------------
13
WRITE/ERROR 16-JAN-1999 KB
15
WRITE/ERROR err_spec [message]
16
force an error within a Midas procedure
19
Enforce a Monitor or application error from a Midas procedure.
22
WRITE/ERROR err_spec [message]
24
err_spec = errno[,err_source[,display_flag]] with
26
errno = error no., err_source = MONITOR or APPLIC,
28
for APPLIC you can also set display_flag for `message' to
31
for MONITOR `message' is always displayed;
35
message = optional text string to be displayed
38
WRITE/OUT, HELP/KEYW PROGSTAT
41
For Monitor errors, the error no. should be > 0;
43
then it serves as pointer into the relevant section in the
44
ASCII file MID_MONIT:syserr.dat .
46
The text in this section is displayed (after display of
47
`message', if any) and also stored in the keyword MID$ERRMESS.
49
If error no. < 0 just the text "Error no. `errno'" is stored
52
For application errors, `message' itself is displayed if the
53
display_flag is set to Yes (default) and always stored
54
in MID$ERRMESS. If no `message' given, it's set to
57
The value of `errno' is always stored in keyword PROGSTAT(1)
59
The procedure containing WRITE/ERROR as well as any procedure
60
calling this procedure will be aborted.
64
WRITE/ERROR 5 "my error stuff"
66
This line in a procedure would result in the following output:
69
if you're an expert user, or:
71
Wrong syntax... Use the HELP command to verify the command syntax.
72
if you're a novice user
74
because file MID_MONIT:syserr.dat contains:
76
Wrong syntax... Use the HELP command to verify the command syntax.
78
The procedure will then terminate and also any procedure calling
81
Keword MID$ERRMESS will contain the string:
82
Wrong syntax... Use the HELP command to verify the command syntax.
86
Invalid input... The input for this MIDAS command is not correct.
87
Check the spelling of names, the data format, the file protection,
89
Use the HELP of the command to check out the parameters.
91
Keword MID$ERRMESS will contain the string:
92
Invalid input... The input for this MIDAS command is not correct.
94
WRITE/ERROR 5,app "my error stuff"
95
leads to the display of:
97
And also keword MID$ERRMESS will contain the string above.
100
leads to the display of:
102
And also keyword MID$ERRMESS will contain the string above.
104
WRITE/ERROR 100,app,no
105
doesn't display anything but stores the message: "Error no. 100"
106
into keyword MID$ERRMESS.