cfunc.send C Function/C Functions


Command cfunc.send C Function/C Functions
Applicable release versions: AP 6.1
Category C Functions (120)
Description equivalent to the Pick/BASIC statement: send{x} string{:} to port.number

The type parameter is a bit mask that may be used to set various options that must or'ed together:

_CP_SEND_X requests the "sendx" form of send.
_CP_SEND_N suppresses the new-line
_CP_SEND_ELSE indicates an else condition

This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Syntax int _CP_send(int type, CPSTR* string, int port.number)
/* The following example sends "hi" to port 1. */

CPSTR * s = _CP_mkstr("dev-att 1");
CPSTR * t = _CP_mkstr("hi");
CPSTR * c = _CP_str_null;
CPSTR * r = _CP_str_null;

_CP_send(0, t, 1);
Related cfunc.introduction