Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 14
Adding a DEFINE to the Context of Your Process
2057 indicates that the working set is incomplete: that is, a required parameter for
the DEFINE CLASS is missing.
2058 indicates that the working set is inconsistent; CHECK^NUM qualifies the
inconsistency. For more information about CHECK^NUM, refer to the Guardian
Procedure Errors and Messages Manual.
2059 indicates that the working set is invalid.
The system also checks the assigned attributes when you call the DEFINEADD
procedure to add the DEFINE to the context of your process.
Adding a DEFINE to the Context of Your Process
After setting the attributes in the working set, you can assign a DEFINE name to that
attribute set and save it in the context of your process. You do this using the
DEFINEADD procedure:
DEFINE^NAME ':=' "=TAPE1 ";
ERROR := DEFINEADD(DEFINE^NAME,
!replace!,
CHECK^NUM);
CASE ERROR OF
BEGIN
0 -> !no error
2049 -> !syntax error in name
2050 -> !DEFINE already exists
2051 -> !DEFINE does not exist
2052 -> !can’t get file-system buffer space
2053 -> !can’t get physical memory
2054 -> !bounds error
2057 -> !incomplete
2058 -> !inconsistent
2059 -> !invalid
2066 -> !missing parameter
2069 -> !DEFINE type not permitted
OTHERWISE -> !some other problem
END;
When you add a DEFINE to the context of your process, the system checks the values
that you specified to ensure that they are consistent, complete, and valid. If they are
not, a nonzero value is returned. If the error number returned is equal to 2058, then
the system is reporting an inconsistency. The inconsistency is qualified in
CHECK^NUM. The Guardian Procedure Errors and Messages Manual describes each
error.
You can also use the DEFINEADD procedure to replace a DEFINE by the same name
in the context of your current process. To do this, you need to set the second
parameter of the DEFINEADD call to 1.
LITERAL REPLACE = 1;
.
.
DEFINE^NAME ':=' "=TAPE1 ";