Owner's Manual (Complete)

Chapter 11 - Expressions
The Home Control Assistant
5
In these elements, an Embed Expression button appears. This lets you build an expression then
encloses it in %’s when it places the expression into the element’s properties.
Error Handling
Because these elements happen at a more complex layer of HCA than most elements, errors can
happen that could not be detected in the Visual Programmer. If errors occur while executing these
elements, the errors are logged, the Compute or Compute Test element is abandoned, and
execution continues with the next element. In the case of the Compute Test element execution
follows the Yes path. These errors show up with a red "P" marker and can be filtered as an Error.
Some of the possible errors are:
Naming a device, thermostat or a magic module as an argument to a function and no device,
thermostat, or magic module with that name in your design.
Divide by zero.
Using a weather function but no weather provider available.
Trying to construct a date-time with something out of range. Like a month of 13.
Expression Syntax
HCA expressions are very similar to expressions in any programming language like Visual Basic
or VBScript. The usual operators are available:
< > <= >= <> ==
(
Note that the operator that checks for equality is 2 equal signs not one)
+ - * / mod and or not eqv imp xor
- (unary minus) + (unary plus)
Date and Time constants enclosed in #'s as: #1/15/2001 07:19 AM#
Boolean constants: Yes No
String constants can be enclosed in single or double quotes
If you are using a flag in an expression and the name of that flag has a blank in it, enclose the flag
name in square brackets. For example [My Flag]
In creating expressions there are a number of functions that HCA provides. Some of these are very
general and can be found in almost any programming language, and others are specific to HCA.
All functions provided by HCA begin with the underscore character. As long as none of your flag
names begin with an underscore, if in subsequent versions of HCA new functions are added, none
of your flag names will conflict with any new function names.
Hint: Don’t start any of your flag names with the underscore character.