Specifying the Target Machine For a Single Command

To specify the target machine for a single command, use the machine handle operator on the command. For example, to execute the SYS_SetDir function on the target machine specified by the sMachine1 variable, type sMachine1->SYS_SetDir (sDir).

To allow you to conveniently perform system related functions (SYS_) on the host, you can preface the function call with the machine handle operator, specifying the globally defined constant hHost as the argument to the operator. For example, to set the working directory on the host machine to c:\mydir, type hHost->SYS_SetDir ("c:\mydir").

You can use this syntax with a method call, for example sMachine-> TextEditor.Search.Find.Pick, but when invoking a method, this form of the machine handle must be the first token in the statement.

If you need to use this kind of statement, use the alternative form of the machine handle operator described below.

You can use the SetMachine function to change target machines for an entire block of code.

The hHost constant cannot be used in simple handle compares like hMyMachineHandle== hHost. This will never be TRUE. A better method is to use GetMachineName(hHost) and compare names. If hHost is used as an argument, it will refer to the "(local)" host not the target host.

Example

The following example shows valid and invalid syntax:
// Valid machine handle operator use
for each sMachine in lsMachine
  sMachine-> TextEditor.Search.Find.Pick

// Invalid machine handle operator use with method
if (sMachine->ProjX.DuplicateAlert.Exists())
  Print ("Duplicate warning on {sMachine} recipient.")

If you need to use this kind of statement, use the alternative form of the machine handle operator described below.

You can use the SetMachine function to change target machines for an entire block of code.

The hHost constant cannot be used in simple handle compares, like hMyMachineHandle== hHost. This will never be TRUE. A better method is to use GetMachineName(hHost) and compare names. If hHost is used as an argument, it will refer to the local host, not the target host.