Guardian Programmer's Guide

Table Of Contents
Using DEFINEs
Guardian Programmer’s Guide 421922-014
7 - 36
Using DEFINEs: An Example
!------------------------------------------------------------
! Procedure to prompt the user for all attributes for a CLASS
! CATALOG DEFINE.
!------------------------------------------------------------
PROC SET^CATALOG;
BEGIN
STRING .VALUES^LIST[0:BUFSIZE - 1];
STRING .NAME[0:15];
NAME ':=' "CLASS ";
VALUES^LIST ':=' "Must be CATALOG" -> @S^PTR;
CALL DEFINE^ATTR(NAME,VALUES^LIST,
@S^PTR '-' @VALUES^LIST);
NAME ':=' "SUBVOL ";
VALUES^LIST ':=' "Any valid subvolume name" -> @S^PTR;
CALL DEFINE^ATTR(NAME,VALUES^LIST,
@S^PTR '-' @VALUES^LIST);
END;
!------------------------------------------------------------
! Procedure to process an invalid command. The procedure
! informs the user that the selection was other than a number
! in the range 1 through 7.
!------------------------------------------------------------
PROC INVALID^SELECTION;
BEGIN
PRINT^BLANK;
! Inform the user that the selection was invalid and
! then return to prompt again for a valid function:
PRINT^STR("INVALID SELECTION: " &
"Type number in range 1 through 7. ");
END;