Next: , Previous: , Up: Expressions: The Engine of STARTER   [Contents]


2.3.6.2 Boolean Logic: Everything is a Number

In STARTER, TRUE and FALSE are simply aliases for constants:

FALSE

Is exactly 0.

TRUE

Is exactly 1.

However, the system evaluates any non-zero value as TRUE. This is a classic programmer’s concept, but it’s vital for clever automation. For example:

beep:status {
    SET TRUE WHEN time:minute;
    SET FALSE WHEN TRUE;
}

Why would this make the computer beep almost all the time? Because time:minute is only 0 at the very start of the hour. For every other minute (1 through 59), the value is non-zero, which the system interprets as TRUE. The beep only stops for that first minute of the hour!