| 
 | 
  | 
 
  
  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 option code of the entry,
        identifies 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, result);
 
    
    - {one option entry}
- 
    
    
  - ADDOPT (opt, 0, 8, 2, data_offset,result);
 
    
    - {first entry is entry zero, option code 8; entry's data area contains a
        2-byte integer specifying an offset from data parameter
        address}
 
    
    - IPCSEND (cd, data, dlen,flags,opt, result);
 
    
    - {sends data located at offset from data address specified in
        opt}
 
   
  INITOPT and ADDOPT allow you to initialize the
  opt parameter for use in another intrinsic. These auxiliary
  intrinsics make the structure of the opt parameter largely
  transparent.
  
  Condition codes returned by ADDOPT are:
  
    - CCE — Succeeded.
 
    
    - CCL — Failed because of a user error.
 
    
    - CCG — Not returned by this intrinsic.
 
   
  This intrinsic can be called in split stack mode.
  
 
 |