Owner's Manual (Complete)
The Home Control Assistant
1
Chapter 11
Expressions
This chapter describes the expression services in HCA. Expressions are used like in a traditional
programming language to change the value of a variable – in HCA called flags.
This chapter covers these topics:
Introduction to HCA expressions
The Visual Programmer Compute and Compute Test elements
The expression builder
Managing flags
Important uses of flags besides the Visual Programmer
Error handling
Expression syntax and built-in functions
In most cases the simpler flag values – Yes and No – and the three Visual Programmer elements –
Make flag yes, Make flag No, and Not flag are sufficient for applications. The Compute and
Compute test elements are used for more sophisticated programming.
Introduction to expressions
As described in the chapter on the Visual Programmer, HCA flags are usually used with simple
Yes and No values. But in addition to those you can create and manipulate variables that can store
text, numeric, Boolean, or date-time values.
To maintain compatibility with previous HCA versions, these variables are still called "flags".
Each flag can contain data of any type. HCA converts the data to the type it needs for the operator
being evaluated. For example, consider these expressions:
a = 10
b = 20
c = "The result is" + (a + b)
d = #01-01-2001#
e = a - "8"
After these expressions are evaluated:
a is a number with value 10
b is a number with value 20
c is a string with value "The result is 30"
d is a date
e is a number with value 2
If you understand, or can learn about, how expressions in traditional programming languages like
Visual Basic work, you will understand HCA expressions.