Element: channel.exec { }

Type

callback

Description

A set of commands to be executed when data is available for reading on channel. This element, which becomes active when the channel.poll element is set, applies only to external process channels which have been opened for read or read/write, socket channels open for read or read/write, and text file channels open for read-only. A text file within an application library cannot be polled.

On newly-opened channels, this element has no value.

When this procedure is executed, the channel identifier is passed to it as parameter 1, and the text read from the channel is passed as parameter 2.

Parameters

channel.exec (<channel>,<string>)

Examples

chan1.exec = {
    args ch=channel, data=string
    tell <'Data read:', data>
}

The callback may be called explicitly if required. This may be done in one of two ways:

# Assume mychan is the channel identifier.
channel.exec(mychan,'Text')

or

mychan.exec('Text')