Using NS3000/iX Network Services (36920-90008)

148 Chapter 7
Remote Process Management
ADDOPT
ADDOPT
Adds an option entry to the opt parameter.
Syntax
ADDOPT (opt,entrynum,optioncode,datalength,data[,result])
Parameters
opt
(input/output) Record or byte array, by reference. The opt
parameter to which you want to add an entry. Refer to
“Common Parameters” for more information on the
structure of this parameter.
entrynum (input) 16-bit integer, by value. Indicates which entry is to
be initialized. The first entry is entry zero.
optioncode
(input) 16-bit integer, by value. The entry’s option code,
identifying the option.
datalength
(input) 16-bit integer, by value. The length (in bytes) of the
data associated with the option.
data (input) Byte array, by reference. The data associated with
the option.
result (output) 16-bit integer, by reference. The error code
returned; zero if no error.
Description
The ADDOPT intrinsic specifies the values of an opt parameter's option
entry fields and adds any associated data. The intrinsic also updates
the size of the opt parameter.
The parameter must be initialized by INITOPT before options are added
by ADDOPT. Consider this program fragment:
data_offset:=10;
{10 bytes from beginning of data array]
INITOPT(opt, 1);
{one option entry}