Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
The Somusar/SoProTech[tm] Booklet Series
Volume VI

"somusar/Tefigel: Reference Guide"

Printer friendly


Contents
1. Introduction
2. File Sections
3. Commands and Instructions
4. Markers
5. Comments
6. Special Characters
7. Variables
8. Arithmetic Computation
9. Boolean Computation
9.1 Purpose
9.2 Usage
9.3 Description
10. Control Flow
11. Subroutines and Functions
12. Built-in Functions
13. Input and Output
14. Packages and Libraries
15. Tag File Processing
16. CSV File Processing
17. Filters
18. Links and Traps
19. Name Spaces
20. Miscellaneous
21. Further Reading

Chapter 9 - Boolean Computation

9.1 - Purpose        top

Perform simple boolean (logical) computation.

9.2 - Usage        top

Evaluate a plain boolean comparison storing the result into a variable:

   eval <target-variable> <boolean-comparison>
Compute boolean and or or operation:
   <boolean-instruction> <target-variable> <boolean-comparison>
Compute boolean not operation:
   not <boolean-variable>

9.3 - Description        top

The <boolean-instruction> must be either and or or.

A <target-variable> is defined as the identifier of a <variable> whose value will be set to 1 or 0 depending on the boolean result - true or false, respectively - yielded by the boolean comparison or operation.

A <boolean-variable> is defined as the identifier of a <variable> whose current value is a string representing a number, the boolean value of which will be considered false if the number equals 0, true if the number equals 1, or invalid otherwise.

A <boolean-comparison> is defined as follows:

   <comparison-variable><comparison-operator><comparison-value>
   <comparison-variable>
A <comparison-variable> is the identifier of either a <variable> or an <associative-variable>, possibly not set yet.

A <comparison-value> can be either a <variable>, or a string of characters, possibly empty.

The <comparison-operator> must be one of the following characters:

With the exception of comparison operator ~, that always implies a pattern-matching comparison between one string value and a regular expression, the type of comparison performed by Tefigel depends on the value of <comparison-variable> and <comparison-value>: if both values are numerical, then a numerical comparison takes place, otherwise a lexicographical comparison is performed.

A <boolean-comparison> with no <comparison-operator> and no <comparison-value> is assumed to be as follows:

   <comparison-variable>#0

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / tefigel_ref  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster