Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 60
Programming the Server
! Write the new record to the file:
CALL WRITEUPDATEUNLOCKX(PARTFILE^NUM,REQUEST.PART,
$LEN(PART^RECORD));
IF <> THEN
BEGIN
CALL FILE_GETINFO_(PARTFILE^NUM,REPLY^ERROR);
RETURN;
END;
REPLY^ERROR := 0;
END;
!------------------------------------------------------------
! Procedure to read the next record from the data file.
! The requester supplied the part number of the last
! record read.
!------------------------------------------------------------
PROC READ^NEXT^RECORD;
BEGIN
INT ERROR;
INT COUNT^READ;
INT POSITIONING^MODE;
! Position approximately to the selected record, unless it
! is the exact record:
POSITIONING^MODE := %B1000000000000000;
CALL KEYPOSITION(PARTFILE^NUM,REQUEST.PART.PART^NUMBER,
!key^specifier!,
!length^word!,
POSITIONING^MODE);
IF <> THEN CALL FILE^ERRORS(PARTFILE^NUM);
! Read the selected record:
CALL READX(PARTFILE^NUM,PART^RECORD,$LEN(PART^RECORD));
IF <> THEN
BEGIN
CALL FILE_GETINFO_(PARTFILE^NUM, REPLY^ERROR);
RETURN;
END;
REPLY^ERROR := 0;
END;