Index

String

An arbitrary command string to be sent to a miscellaneous external device.

Input Format:

A sequence of printable characters. Upper case characters are automatically converted to lower case when a value of this type is read.

If the string is enclosed between double quotes, then any printable character may be included in the string, and C-style escapes may be used to include unprintable characters.

Alternatively, if the string is not enclosed between double quotes, then there are some restrictions on what it may contain. In particular, if parentheses are used, then open parentheses must be matched by corresponding close parentheses. Commas can only be included between such matching parentheses. Outside of parentheses, a comma is interpretted to indicate the end of the string, and the start of a new argument. Double quotes may be included in a string if escaped.

Examples:
The following example tells a device called "foo" to turn on a switch for 10 seconds. For the sake of the example, it uses variables to pass the corresponding command strings to the device, instead of passing them literally to the tell command.
 ReceiverCmd foo_on = "switch_state=on"
 ReceiverCmd foo_off = "switch_state=off"
 tell foo, $foo_on
 until $elapsed > 0:0:10
 tell foo, $foo_off

Martin Shepherd (21-May-2010)