Difference between revisions of "Core.Terms.LogicOperations"
Jump to navigation
Jump to search
m (Nb moved page LogicOperatios to LogicOperations) |
|||
Line 3: | Line 3: | ||
{{ClassificationActivity | LogicOperatios | Basic logical operations with Boolean expressions | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }} | {{ClassificationActivity | LogicOperatios | Basic logical operations with Boolean expressions | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }} | ||
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
BooleanValue = BooleanTerm1 operator BooleanTerm2 | BooleanValue = BooleanTerm1 operator BooleanTerm2 | ||
Line 19: | Line 19: | ||
*: Logical XOR (exclusive disjunction) | *: Logical XOR (exclusive disjunction) | ||
* '''!''' | * '''!''' | ||
− | *: Logical | + | *: Logical NOT (negation) |
{{TermReturnValue| [[Boolean]] | Return value from the logical operation}} | {{TermReturnValue| [[Boolean]] | Return value from the logical operation}} | ||
Line 30: | Line 30: | ||
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Boolean MyValueOfBool1; | |
− | + | Boolean MyValueOfBool2; | |
− | + | Boolean result; | |
− | + | ||
+ | result = MyValueOfBool1 && MyValueOfBool2; | ||
+ | result = MyValueOfBool1 || MyValueOfBool2; | ||
+ | result = MyValueOfBool1 ^ MyValueOfBool2; | ||
+ | result = !MyValueOfBool1; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 03:49, 4 February 2015
Contents
Classification
Name | LogicOperatios |
Short Description | Basic logical operations with Boolean expressions |
Class | Term |
Extension | OTX Core library |
Group | Operations |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
BooleanValue = BooleanTerm1 operator BooleanTerm2
BooleanValue = !BooleanTerm1
Description
Logical operators are used according to the C# notation for logical operations in the formulation of conditions etc. The following operators can be used:
- &&
- Logical AND (conjunction)
- ||
- Logical OR (disjunction)
- ^
- Logical XOR (exclusive disjunction)
- !
- Logical NOT (negation)
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Boolean | Return value from the logical operation |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
BooleanTerm1 | Boolean | Term | - | [1] | Left operand |
BooleanTerm2 | Boolean | Term | - | [1] | Right operand |
OTL Examples
Boolean MyValueOfBool1;
Boolean MyValueOfBool2;
Boolean result;
result = MyValueOfBool1 && MyValueOfBool2;
result = MyValueOfBool1 || MyValueOfBool2;
result = MyValueOfBool1 ^ MyValueOfBool2;
result = !MyValueOfBool1;