Bool

From ObjectVision

Jump to: navigation, search

Conversion functions bool

Contents

concept

  1. bool is a 1 bits sub byte value type, 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.

The next topics on this page describe 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

since version

5.15

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

Personal tools