Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 45
Programming the Requester
! Send the request to the server. If no such record exists,
! the procedure informs the user and returns control to
! the main procedure:
CALL WRITEREADX(SERVER^NUM,REQUEST,$LEN(REQUEST),
$LEN(PART^RECORD),COUNT^READ);
IF <> THEN
BEGIN
CALL FILE_GETINFO_(SERVER^NUM,ERROR);
IF ERROR = 11 OR ERROR = 1 THEN
BEGIN
PRINT^BLANK;
START^LINE;
PUT^STR("No such record");
PRINT^LINE;
RETURN;
END
ELSE CALL FILE^ERRORS(SERVER^NUM);
END;
! Save the record in the REQUEST structure for later
! comparison by the server:
PART^RECORD ':=' REQUEST FOR $LEN(PART^RECORD) BYTES;
REQUEST.OLD^PART ':=' PART^RECORD FOR $LEN(PART^RECORD)
BYTES;
REQUEST.PART ':=' PART^RECORD.PART^NUMBER FOR PARTSIZE;
! Display the record on the terminal:
CALL DISPLAY^RECORD;
! Prompt the user for the updated record:
CALL ENTER^RECORD(OLD);
! Fill in the part number:
REQUEST.PART.PART^NUMBER ':=' PART^RECORD.PART^NUMBER
FOR PARTSIZE;