Variable data types
webCoRE supports several variable data types.
Dynamic variables are also known as loose-typed variables. They don't have a set type and can therefore contain any kind of data, from numbers, to strings, to booleans, etc. It is strongly recommended to use a strong-typed variable instead when the values you are planning on storing are of a certain type.
String variables can contain any text/number/boolean values represented as a string, for example:
"abc123". Note: storing numbers in string variables may lead to undesired results if you plan on comparing values. As strings,
"100"<code> is smaller than <code>"50" because comparisons are made using character codes rather than overall values. Since 1 is before 5 in the alphabet,
"100" is smaller than
Booleans are simple types that can contain one of two values: false or true. When converted to a string, these become
"true". When converted to a number, these become
An integer variable can only store whole numbers, for example:
3983. If you attempt to store a decimal value into an integer variable, the decimal digits are simply dropped (floor).
A decimal variable can contain rational numbers in the decimal form, for example
209.292929. It can also contain whole number values.
Date and Time
A variable of date and time represents a single point in time representing both date and time, for example
8/7/1980 08:39:29 AM.
A variable of date represents a single day, for example
A variable of time represents a single point in time that can happen each day, for example
Device variables can store device handlers such as
Kitchen Light. What's special about this type is that it can contain one or more devices (array).