SEND Statement
Sends data to a communicating program.
Syntax
SEND data TO session{,reference} {USING function{,qualifier}} {SETTING error} [THEN statement(s) | ELSE statement(s)]
Syntax Elements
data An expression that evaluates to the data to be sent.
session A variable containing a session reference (assigned by an ACCEPT or CONNECT statement) that specifies the connection on which the data is to be sent.
reference An expression that evaluates to a numeric reference for the data to be sent.
function An expression that evaluates to a further numeric reference. function must be a positive integer between 0 and X'3FFF' (16383).
qualifier An expression that evaluates to a string qualifier for the data to be sent.
error A variable that is set to a return value. If the data is sent successfully, error is set to 0 and the THEN clause is executed. If an error occurs, error is set to the appropriate error code and the ELSE clause is executed. The error codes and corresponding messages are given in File I/O and IPC Error Codes).
A THEN or an ELSE clause, or both, must be included.
statement(s) A sequence of one or more valid DataBasic statements, either separated by semicolons or contained on separate lines and followed by an END statement.
Operation
The SEND statement sends data to the program identified by session. If the data is sent successfully, the THEN clause is taken and error is assigned a value of 0. If the data is not sent, an error condition is received, the ELSE clause is taken, and the appropriate error code is assigned to error.
Example
CONNECT SYS3 TO STOCK-SYS ELSE GOSUB 99
SEND ORDER/STOCK-SYS TO SETTING ECODE ELSE GOSUB 71