Boolean Operator (FPScript)
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
ComplexFloatingPoint32 Operator