Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 57
Programming the Server
!------------------------------------------------------------
! This procedure reads one record from the data file.
! It is invoked in response to a READ^APPROX request issued
! by a requester process.
!------------------------------------------------------------
PROC READ^APPROX^RECORD;
BEGIN
INT COUNT^READ;
INT ERROR;
! Position approximately to the selected record:
CALL KEYPOSITION(PARTFILE^NUM,
REQUEST.PART.PART^NUMBER,
!key^specifier!,
!length^word!,
0);
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;