## The `Execute' method

Argument: Character vector
Result: None

Valid for: APL (child task) object

The `Execute` method allows the parent to cause the child task to execute an APL expression or system command. It takes as an argument a character string which is the command to be executed (or passed as input to « or Œ).

The child task should be awaiting input (you can tell whether this is the case by reading the `status` property, or by using the `onReady` callback). If it is not, the command will be placed in a buffer and will be executed when the child task next asks for input. However, there is no queue of commands held; any existing command already in the buffer will be over-written if the child task has not yet executed it. The `Execute` method returns immediately; it does not wait for the command to complete.

In this example, the child task is initially ready for input. It then executes the )LOAD command, and is busy for a short time (`status` property is 0). The `status` property then changes back to 1 when it is ready for further input:

          ChildTask.status
    1
          ChildTask.Execute ')LOAD 10 SAMPLEEXCEL'
          ChildTask.status
    0
          ChildTask.status
    1

Note that in a real multi-tasking APLX application you would typically use the `Signal` method and `onSignal` events to allow the parent and child tasks to communicate with each other and synchronize their operations. The `Execute` method would typically be used only when starting up the child task.

Topic: APLX Help : System Classes : Methods : Execute

[ Previous | Next | Contents | Index ]