Element: channel.command( )

Type

numeric func

Description

Execute a command line on the peer process to which the channel is connected.

The channel must be a peer channel. For all other channels, this function is a no-op.

Multiple commands can be separated by semi-colon characters.

The following values are returned by this function:

0 - when the command line was received by the peer and processed (successfully or otherwise),

-1 - when a communication error has occurred.

The code of the function cannot be redefined.

Parameters

<channel>.command(<commands> {,<sync>)

Notes

The channel timeout will be used by this function. If the peer process has not responded within the timeout period, an error will be recorded.

Example

Open a channel to a peer, whose network socket is known, and execute a macro. The network socket of the current process is also passed to the peer, in case the peer wants to communicate back in an equivalent fashion. We are not interested in waiting for a reply, so the function passes the <async> parameter as 1.

open ch,-peer='localhost:65132',-tim=5
unless (err) {
   ch.command('exec c:/files/update.cmd(network_socket)',1)
   ch.close
}

See Also

Commands:

open

Identifiers:

chan# (channel)

Structures:

channel, channel.close, channel.evaluate, channel.timeout