Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 22
Using DEFINEs: An Example
!----------------------------------------------------------
! Procedure to print DEFINE errors on the terminal.
!----------------------------------------------------------
PROC DEFINE^ERRORS(ERR^NUM);
INT ERR^NUM;
BEGIN
! Display the error number:
START^LINE;
PUT^STR("DEFINE error ");
PUT^INT(ERR^NUM);
CALL WRITEX(TERMNUM,SBUFFER,@S^PTR '-' @SBUFFER);
! Put the error text in the output buffer:
START^LINE;
CASE ERR^NUM OF
BEGIN
2049 -> PUT^STR("A syntax error occurred in name");
2050 -> PUT^STR("DEFINE already exists");
2051 -> PUT^STR("DEFINE does not exist");
2052 -> PUT^STR
("Not enough buffer space or PFS allocation failed");
2053 -> PUT^STR("Unable to obtain physical memory");
2054 -> PUT^STR("Bounds error on parameter");
2055 -> PUT^STR("Attribute not supported");
2057 -> PUT^STR("DEFINE or working set incomplete");
2058 -> PUT^STR
("DEFINE or working set is not consistent");
2059 -> PUT^STR("DEFINE or working set is invalid");
2060 -> PUT^STR("No more DEFINEs");
2061 -> PUT^STR("No more attributes");
2062 -> PUT^STR("Attribute name too long");
2063 -> PUT^STR
("A syntax error occurred in DEFAULT^NAMES");
2064 -> PUT^STR("The attribute cannot be reset");
2066 -> PUT^STR("Missing parameter");
2067 -> PUT^STR
("Attribute contained an illegal value");
2068 -> PUT^STR("Saved DEFINE was of invalid CLASS");
2069 -> PUT^STR
("The DEFINE mode of the process does not "
& "permit the addition of the DEFINE type");
2075 -> PUT^STR("Invalid options parameter");
2076 -> PUT^STR("User's buffer is too small");
2077 -> PUT^STR
("Buffer or DEFINE name is an invalid segment");
2078 -> PUT^STR
("Buffer does not contain a valid saved DEFINE");
OTHERWISE -> PUT^STR("Error number unrecognized");
END;