Basic Data Type Entities (INT, DOUBLE, STRING, BOOL)
LOT handles basic data types implicitly. While you don't explicitly declare variables with types like INT
or STRING
in LOT code itself (like you might in general-purpose programming languages), the language engine and associated components understand and operate on these fundamental types.
INT
- Description: Represents whole numbers (integers).
- Usage: Used in mathematical expressions, comparisons, and published as numeric payloads.
- Example:
DOUBLE
- Description: Represents numbers with decimal points (floating-point numbers).
- Usage: Used in mathematical expressions, comparisons, and published as numeric payloads.
- Example:
STRING
- Description: Represents sequences of text characters.
- Usage: Used for status messages, identifiers, configuration values. String literals are enclosed in double quotes (
"
). - Example:
BOOL
- Description: Represents boolean values
true
orfalse
. - Usage: Primarily the result of comparison and logical operations, used in
IF
conditions. While you don't typically publishtrue
/false
directly, conditions evaluate to boolean. - Example:
Type Conversion
LOT often performs automatic type conversion where appropriate, especially between numeric types and strings that represent numbers in mathematical or comparison operations.
// If topic "count_str" holds the string "5", LOT treats it as number 5 here
PUBLISH TOPIC "count_num" WITH (GET TOPIC "count_str" + 1)
Related Documentation