Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 47
Programming the Requester
!------------------------------------------------------------
! Procedure for inserting a record. The user selected
! function "i." The user is prompted to enter the new record.
! The procedure inserts the new record in the appropriate
! place in the file.
!------------------------------------------------------------
PROC INSERT^RECORD;
BEGIN
INT ERROR;
PRINT^BLANK;
! Set the REQUEST^FUNCTION:
REQUEST.REQUEST^FUNCTION := WRITE^ONE;
! Prompt the user for the new record:
CALL ENTER^RECORD(NEW);
! Send the new record to the server:
CALL WRITEREADX(SERVER^NUM,REQUEST,$LEN(REQUEST),
$LEN(PART^RECORD));
IF <> THEN
BEGIN
CALL FILE_GETINFO_(SERVER^NUM,ERROR);
IF ERROR = 10 THEN
BEGIN
PRINT^BLANK;
PRINT^STR
("Already a record with that part number.");
PRINT^STR("Your new one was not entered.");
END
ELSE BEGIN
CALL FILE^ERRORS(SERVER^NUM);
END;
END;
END;