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

Table Of Contents
Chapter 4 143
NetIPC Examples
Example 2
writeln ('dlen was not = 21');
{ Check that the correct data was received }
expect := 'Abaracadabara magic!';
error := false;
for i := 1 to dlen do
if messag1[i] <> expect[i] then
error := true;
if error then
begin
writeln ('did not receive expected data, got:');
writeln ( messag1 );
end;
{ Clean up and shutdown }
{ shutdown the local connection descriptor }
ipcshutdown ( cd_local, , , result );
if result <> 0 then
writeln ('ipcshutdown cd_local failed');
{ shutdown the local socket descriptor }
ipcshutdown ( sd_local, , , result );
if result <> 0 then
writeln ('ipcshutdown sd_local failed');
end.
Program 2B (Vector2)
{**********************************************************************}
{ This program pair, vector1 and vector2, gives an example of how to }
{ send and receive vectored data, both in Compatibility Mode and }
{ Native Mode. To compile in Native Mode, set the native_mode flag to }
{ true; compile with "pasxl svector2,,$null" and link with }
{ "link $oldpass,nvector2". Run nvector1 before running nvector2. }
{ To compile in Compatibility mode, set the native_mode flag to false; }
{ compile with "pascal svector2,,$null" and link with }
{ "prep $oldpass,pvector2". Run pvector1 before pvector2. You can }
{ run pvector1 with nvector2 or nvector1 with pvector2. }
{**********************************************************************}
$set 'native_mode = true '$
$stats off$
$code_offsets on$
$tables on$
$lines 120$
$if 'native_mode'$
$standard_level 'hp_modcal'$
$type_coercion 'conversion'$
$else$
$uslinit$
$endif$
program vector2 (input,output);