When connecting to an application we give it a label. Then application commands are prefixed by the application label and a ``.'' (dot) to help distinguish them from each other and from console commands. All application commands are sent to the application to execute there. Each returns an array of values to the console. An application command can also be surrounded by backticks to capture the first element of this array:
connect myapp app-warrant.xml # Connect to a running application and label it
myapp.hello # Execute the application's "hello" command
myapp.hello {int:123} # Execute the command with a parameter
set var=`myapp.goodbye` # Set $var to be the first return value of
# the "goodbye" command
connect app2 app2-warrant.xml # Connect to a second application
app2.update $var # Execute its "update" command using the property
# obtained from the first application.
Each element of the returned array is also stored in the console variable bearing its index: $0, $1, $2, and so on. So it's $0 that is returned by backticks.
Console variables %0, %1, %2, etc are set to be the extra arguments, if any, that we gave to the console when we started it. This makes it easy to pass in variables from outside the console. See also the script command below.
Nik Silver 2002-03-09