Bool

conversion-functions bool

concept

  1. bool is a 1 bits sub-byte-element, with as possible values: True and False.
  2. bool() is a function converting data items or units of other value types to the bool value type.

This page describes the bool() function.

syntax

  • bool(a)

definition

bool(a) results in a boolean (True or False) item converted from item a. The function results for:

  • numeric data items in True for non zero values and False for zero values of data-item a;
  • string data items in True for all values starting with the character “T” and False for other values of data item a.
  • units, a boolean (1 bit) unit of the converted unit.

applies to

  • data item or unit with Numeric, uint2, uint4 or string value type

example

1. attribute<bool> boolA (ADomain) := bool(A);    
2. attribute<bool> boolB (ADomain) := bool(B);
A(float32) B(string) boolA boolB
0 ‘Hello’ False False
1 ‘Test’ True True
1000000 null True False
-2.5 ‘Two words’ True True
99.9 ‘88a’ True False

ADomain, nr of rows = 5