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

Table Of Contents
Chapter 4 139
NetIPC Examples
Example 2
Example 2
This pair of programs show the differences in compiler options for
writing NetIPC programs to run in compatibility mode and native
mode. The programs are designated vector1 and vector2. You can
compile them in either compatibility mode or native mode as described
in the comments preceding the programs.
Program 2A (Vector1)
{**********************************************************************}
{ 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 svector1,,$null" and link with }
{ "link $oldpass,nvector1". Run nvector1 before running nvector2. }
{ To compile in Compatibility mode, set the native_mode flag to false; }
{ compile with "pascal svector1,,$null" and link with }
{ "prep $oldpass,pvector1". 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 vector1 (input,output);
TYPE
byte = 0..255; { this is one byte long }
shortint = -32768..32767; { this is two bytes long }
CONST
$if 'native_mode'$
DESC_TYPE = 4; { descriptor type for 64b ptr }
DESC_LEN = 12; { length of NM vector descriptor}
$else$
DESC_TYPE = 0; { descriptor type for CM stack }
DESC_LEN = 8; { length of CM vector descriptor}
$endif$
F_VECTORED = 31; { vectored data }