OTX Reference  
OpenTestSystem.Otx.Core.Terms.ToBoolean Class Reference

Convert expression to Boolean More...

Inheritance diagram for OpenTestSystem.Otx.Core.Terms.ToBoolean:
Inheritance graph

Public Attributes

Term term
 The expression (term) to be converted to Boolean More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Cardinality [0..1]
The MetaData type allows tools to store additional, mainly tool-specific data. More...
 

Detailed Description

Convert expression to Boolean

The ToBoolean term returns the Boolean equivalent of the argument. If the argument is Integer 0, Float 0.0 or an empty ByteField it returns false. In all other cases, true. If the Argument is String "true", it returns true, regardless of the case. In all other cases, false.

Rules

  • Boolean
    Returns a copy of the value.
  • Integer
    Returns false if 0, otherwise true.
  • Float
    Returns false if 0.0, otherwise true.
  • ByteField
    Returns false if empty, otherwise true.
  • String
    Returns true if the string value is "true", ignoring case, otherwise false.
Syntax
BooleanTerm = ToBoolean(Term)
Examples
// Local Declarations
Boolean Boolean1;
Boolean Boolean2;
Boolean Boolean3;
Boolean Boolean4;
Boolean Boolean5;
// Flow
Boolean1 = ToBoolean(true);
Boolean2 = ToBoolean(0);
Boolean3 = ToBoolean(0.00001);
Boolean4 = ToBoolean(&00);
Boolean5 = ToBoolean("tRuE");

Member Data Documentation

◆ term

Term OpenTestSystem.Otx.Core.Terms.ToBoolean.term

The expression (term) to be converted to Boolean