Difference between revisions of "Extensions.Util.ListIndexOf"

From emotive
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
IntegerTerm = Util.ListIndexOf(ListTerm, Term);
+
IntegerTerm Util.ListIndexOf(ListTerm list, Term value);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The OTX '''ListIndexOf''' term  is an IntegerTerm that returns the first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned. '''ListIndexOf''' behavior should be based on the [[Extensions.Util.Compare|'''util:Compare''']] functionality.
+
The OTX '''ListIndexOf''' term  is an IntegerTerm that returns the first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned.
  
 
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | The first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned.}}
 
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | The first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned.}}
Line 22: Line 22:
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 
Integer Integer1;
 
Integer Integer1;
  

Latest revision as of 03:01, 8 November 2018

Classification

Name ListIndexOf
Short Description Gets the first index of a given value
Class Term
Extension OTX Util extension
Group Util related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

IntegerTerm Util.ListIndexOf(ListTerm list, Term value);

Description

The OTX ListIndexOf term is an IntegerTerm that returns the first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned.

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
Integer The first index of a given value in the List. In case the value is not contained inside the list, -1 will be returned.

Properties

Name Data Type Class Default Cardinality Description
List List Term - [1..1] The List which shall be checked for the value.
Value - Term - [1..1] The value whose index in the List shall be determined.

OTL Examples

/// Local Declarations

Integer Integer1;

/// Flow

Integer1 = Util.ListIndexOf({&AA, &AB, &AC}, &AB);

See also

Compare
CopyByteField
GetRandomNumber
IsInitialized
ListIndexOfAny
ListReverse
ListSort
Max
Min
StringFormat