Boolean Operator (FPScript)

23.08.2021

Converts an expression into the Boolean data type.

Syntax

Boolean Expression

The syntax of the Boolean operator consists of the following elements:

Element

Description

Expression

Any expression. All data types are permitted.

Remarks

The operator can process scalar values or entire data series and data matrices. If Expression is a data series or a data matrix, then the type conversion takes place on a per-element basis and the result is once again a data series or a data matrix. If a signal, a signal series or a space curve is converted, only the Y component is examined. The result contains the converted Y component as a data series or data matrix. If Expression is a list, then the operation is executed for each item in the list and the result is also a list.

During the conversion, all values not equal to zero are assigned the value TRUE and accordingly, all values equal to zero are assigned the value FALSE. For complex numbers, real and imaginary parts have to be zero in order to generate the result FALSE. Strings are interpreted as a value or quantity first and then converted like numerical data. Here the decimal and list separators specified in FlexPro Options are used. The Empty type results in FALSE.

If Expression is a quantity, then it has to have the SI dimension 1 and it will be transformed to the unit 1 before conversion.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

Boolean Minimum(Integer16(Absolute(DataSeries1 - DataSeries2) < 0.0001))

Returns TRUE if all values in DataSeries1 and DataSeries2 match exactly in at least four places.

Boolean 1.5

Returns TRUE.

Boolean 0

Returns FALSE.

Boolean -1.5

Returns TRUE.

Boolean "True"

Returns TRUE.

Boolean "1"

Returns TRUE.

Boolean Empty

Returns FALSE.

Boolean 1 N

Returns an error, since the Newton unit does not have the SI dimension 1.

Boolean 2 Pi

Returns TRUE, since the unit Pi has the SI dimension 1 and 2 Pi transformed to the unit 1 results in the value 6.2831853, which is not equal to zero.

 

See Also

Data Types

ChangeDataType Function

Integer16 Operator

Integer32 Operator

Integer64 Operator

FloatingPoint32 Operator

FloatingPoint64 Operator

ComplexInteger16 Operator

ComplexInteger32 Operator

ComplexInteger64 Operator

ComplexFloatingPoint32 Operator

ComplexFloatingPoint64 Operator

String Operator

CalendarTime Operator

TimeSpan Operator

Share article or send as email:

You might be interested in these articles