NetIPC 3000/XL Programmer's Reference Manual (5958-8600)

Table Of Contents
Appendix D 219
Migration From PTOP to NetIPC and RPM
Example: Client-Server Application
readln( name );
if name <> 'EOT' then
begin
PWRITE( dsnum, name, -namelength );
if ccode <> cce then
ERROR( 'PWRITE to server failed.', PCHECK(dsnum) );
length := PREAD( dsnum, info, -infolength );
if ccode = cce then {ACCEPT}
writeln('Client data is: ', info )
else if ccode = ccg then {REJECT}
writeln('Client data could not be found.')
else {ccode = ccl}
ERROR( 'PREAD from server failed.', PCHECK(dsnum) );
end;
until name = 'EOT';
{-------------------------------------------------------------}
{ All names have been processed. Terminate the PSERVER. }
{-------------------------------------------------------------}
PCLOSE( dsnum );
if ccode <> cce then
ERROR( 'PCLOSE on server failed.', PCHECK(dsnum) );
1: {error exit}
end.