OScript API/Built-in Package Index |
A Boolean represents a two-state value, either TRUE or FALSE. Boolean values can be obtained by:
Boolean expressions are created by using relational or logical operators to form an expression whose result is either TRUE or FALSE. For more information about relational and logical operators, see the Operators section of the Oscript Language Reference Manual.
For example, if these variables are declared:
String dataLine Integer count Real x, y Boolean libraryRecords, newRecord
the following are all valid Boolean expressions:
dataLine != "" count <= 5000 y < x libraryRecord && newRecord
Booleans are often used as test criteria in looping or conditional structures. For example:
Boolean done while !done textLine = File.Read( myFile ) allLines += ( textLine + Str.EOL() ) done = File.EOF( myFile ) end
In this example, the Boolean expression !done is evaluated and then script execution branches or continues depending on whether the Boolean expression evaluates to TRUE or FALSE.
Copyright © 2022 OpenText Corporation. All rights reserved. |