Difference between revisions of "Core.Terms.RelationalOperations"

From emotive
Jump to navigation Jump to search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Core]]
+
{{DISPLAYTITLE:OTX '''RelationalOperations'''}}[[Category:Core]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | ComparativeOperations | Basic logical operators for comparisons | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }}
+
{{ClassificationActivity | RelationalOperations | Basic logical operators for comparisons | [[Term]] | [[Core|OTX Core library]] | [[Operations]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
Line 12: Line 12:
  
 
* '''=='''
 
* '''=='''
*: Equality, the expression evaluates to {{FontColor|blue||true}}, if both operands are equal.
+
*: Equivalent to the OTX '''IsEqual''' term, the expression evaluates to {{FontColor|blue||true}}, if all operands are equal.
 
* '''!='''
 
* '''!='''
*: Inequality, the expression evaluates to {{FontColor|blue||true}}, if both operands are not equal.
+
*: Equivalent to the OTX '''IsNotEqual''' term, the expression evaluates to {{FontColor|blue||true}}, if all operands are not equal.
 
* '''>'''
 
* '''>'''
*: Greater, the expression evaluates to {{FontColor|blue||true}}, if the left operand is greater than the right.
+
*: Equivalent to the OTX '''IsGreater''' term, the expression evaluates to {{FontColor|blue||true}}, if the left operand is greater than the right.
 
* '''>='''
 
* '''>='''
*: Greater than or equal, the expression is {{FontColor|blue||true}} if the left operand is greater than or equal to the right.
+
*: Equivalent to the OTX '''IsGreaterOrEqual''' term, the expression is {{FontColor|blue||true}} if the left operand is greater than or equal to the right.
 
* '''<'''
 
* '''<'''
*: Leaster, the expression evaluates to {{FontColor|blue||true}}, if the left operand is less than the right.
+
*: Equivalent to the OTX '''IsLess''' term, the expression evaluates to {{FontColor|blue||true}}, if the left operand is less than the right.
 
* '''<='''
 
* '''<='''
*: Less equal, the expression is {{FontColor|blue||true}} if the left operand is less than or equal to the right.
+
*: Equivalent to the OTX '''IsLessOrEqual''' term, the expression is {{FontColor|blue||true}} if the left operand is less than or equal to the right.
  
{{TermReturnValue| [[Boolean]] | Return value from the logical operation}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | The result of the comparison.}}
  
 
== Properties ==
 
== Properties ==
 +
'''IsEqual, IsNotEqual:'''
 +
 +
{| {{TableHeader}}
 +
{{TableRowPropertiesHeader}}
 +
{{TableRowPropertie2| Terms | [[Core.DataTypes|OTX Term]] | [[Term]] | - | [2..*] | Represents the operands which will be tested for equality or inequality. Terms will be evaluated in the order of appearance in the OTX document.}}
 +
|}
 +
 +
'''IsGreater, IsGreaterOrEqual, IsLess, IsLessOrEqual:'''
 +
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| BooleanTerm1 | [[Boolean]] | [[Term]] | - | [1] | Left operand}}
+
{{TableRowPropertie1| Left | [[Core.DataTypes.SimpleDataType|SimpleDataType]] | [[Term]] | - | [1] | Left operand}}
{{TableRowPropertie2| BooleanTerm2 | [[Boolean]] | [[Term]] | - | [1] | Right operand}}
+
{{TableRowPropertie2| Right| [[Core.DataTypes.SimpleDataType|SimpleDataType]] | [[Term]] | - | [1] | Right operand}}
 
|}
 
|}
  
Line 45: Line 54:
  
 
== See also ==
 
== See also ==
[[LogicOperations]] <br/>
+
[[Core.Terms.LogicOperations|LogicOperations]] <br/>
[[MathematicalOperations]]
+
[[Core.Terms.MathematicalOperations|MathematicalOperations]]

Latest revision as of 11:09, 26 April 2019

Classification

Name RelationalOperations
Short Description Basic logical operators for comparisons
Class Term
Extension OTX Core library
Group Operations
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

BooleanValue = BooleanTerm1 operator BooleanTerm2

Description

Logical comparisons are used according to the C# notation for logical operations in the formulation of conditions etc. The following operators can be used:

  • ==
    Equivalent to the OTX IsEqual term, the expression evaluates to true , if all operands are equal.
  • !=
    Equivalent to the OTX IsNotEqual term, the expression evaluates to true , if all operands are not equal.
  • >
    Equivalent to the OTX IsGreater term, the expression evaluates to true , if the left operand is greater than the right.
  • >=
    Equivalent to the OTX IsGreaterOrEqual term, the expression is true if the left operand is greater than or equal to the right.
  • <
    Equivalent to the OTX IsLess term, the expression evaluates to true , if the left operand is less than the right.
  • <=
    Equivalent to the OTX IsLessOrEqual term, the expression is true if the left operand is less than or equal to the right.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Boolean The result of the comparison.

Properties

IsEqual, IsNotEqual:

Name Data Type Class Default Cardinality Description
Terms OTX Term Term - [2..*] Represents the operands which will be tested for equality or inequality. Terms will be evaluated in the order of appearance in the OTX document.

IsGreater, IsGreaterOrEqual, IsLess, IsLessOrEqual:

Name Data Type Class Default Cardinality Description
Left SimpleDataType Term - [1] Left operand
Right SimpleDataType Term - [1] Right operand

OTL Examples

Integer MyValue1;
Integer MyValue2;
Boolean result;

result = MyValue1 != MyValue2;
result = MyValue1 == MyValue2;
result = MyValue1 >= MyValue2;

See also

LogicOperations
MathematicalOperations