Difference between revisions of "Extensions.Util.Compare"

From emotive
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE: '''Compare'''}}Category:Util == Classification == {{ClassificationActivity | Compare | UPDATING...<!--Create an event source for change event--> | [[Term]...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''Compare'''}}[[Category:Util]]
 
{{DISPLAYTITLE:  '''Compare'''}}[[Category:Util]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | Compare | UPDATING...<!--Create an event source for change event--> | [[Term]] | [[Extensions.Util|OTX Util extension]] | UPDATING... | UPDATING... | UPDATING... }}
+
{{ClassificationActivity | Compare | Tests for equality of two or more Terms | [[Term]] | [[Extensions.Util|OTX Util extension]] | [[Extensions.Util#Terms|Util related terms]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
EventSourceTerm = EventHandling.MonitorChangeEventSource(Variable);
+
BooleanTerm Util.Compare({Term[ ] term});
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== Description ==
 
== Description ==
UPDATING...<!--
+
The OTX '''Compare''' term checks the content and not the reference of ByteField, List and Map. List and Map are checked recursively. For all other data type comparisons, the same behavior as used by the '''otx:IsEqual''' term is used, unless specified otherwise at the definition of the data type. In case of structure the '''util:Compare''' term checks all values deeply.
The OTX '''MonitorChangeEventSource''' term creates an event source that monitors the value of a variable and an event triggers when the value changed. Event queue should start immediately as soon as the event source is created.
 
  
{{Note|The case when a value to a previously uninitialized variable is assigned to count as a change event and make no mistake.}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | The result of the comparision.}}
 
 
{{TermReturnValue| [[Extensions.EventHandling.EventSource|EventSource]] | '''The EventSource''', the changes in the value of a variable monitored.}}
 
  
 
== Properties ==
 
== Properties ==
UPDATING...//
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Variable | - | [[Variable]] | - | [1] | The variable which has to be monitored.}}
+
{{TableRowPropertie2| Term | - | [[Term]] | - | [2..*] | Represents a '''otx:Term''' which shall be compared.}}
 
|}
 
|}
-->
 
  
 
== OTL Examples ==
 
== OTL Examples ==
UPDATING...<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean Bool1 = false;
+
/// Local Declarations
EventHandling.EventSource EventSource1;
+
 
EventHandling.Event Event1;
+
Boolean Boolean1 = false;
 +
 
 +
/// Flow
  
EventSource1 = EventHandling.MonitorChangeEventSource(Bool1);
+
Boolean1 = Util.Compare({{&11, &22, &33}, {&10, &22, &33}});
parallel
 
{
 
  lane
 
  {
 
      Bool1 = true;
 
  }
 
  lane
 
  {
 
      EventHandling.WaitForEvent({EventSource1}, Event1);
 
  }
 
}
 
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
 
  
 
== See also ==
 
== See also ==
 
<!--[[Extensions.Util.Compare|Compare]] <br/>-->
 
<!--[[Extensions.Util.Compare|Compare]] <br/>-->
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 
[[Extensions.Util.CopyByteField|CopyByteField]] <br/>
 +
[[Extensions.Util.GetRandomNumber|GetRandomNumber]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.IsInitialized|IsInitialized]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>
 
[[Extensions.Util.ListIndexOf|ListIndexOf]] <br/>

Latest revision as of 02:30, 8 November 2018

Classification

Name Compare
Short Description Tests for equality of two or more Terms
Class Term
Extension OTX Util extension
Group Util related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

BooleanTerm Util.Compare({Term[ ] term});

Description

The OTX Compare term checks the content and not the reference of ByteField, List and Map. List and Map are checked recursively. For all other data type comparisons, the same behavior as used by the otx:IsEqual term is used, unless specified otherwise at the definition of the data type. In case of structure the util:Compare term checks all values deeply.

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 comparision.

Properties

Name Data Type Class Default Cardinality Description
Term - Term - [2..*] Represents a otx:Term which shall be compared.

OTL Examples

/// Local Declarations

Boolean Boolean1 = false;

/// Flow

Boolean1 = Util.Compare({{&11, &22, &33}, {&10, &22, &33}});

See also

CopyByteField
GetRandomNumber
IsInitialized
ListIndexOf
ListIndexOfAny
ListReverse
ListSort
Max
Min
StringFormat