IN Operator

Official Content
This documentation is valid for:

It is a logical operator that returns true if the left operand value is equal to some of the values enumerated in the right operand.

Syntax

Att | Var | Property IN [(<comma-separated-constant-list>) | Collection | Array

Att IN Data Selector object

Where:
Collection refers to attributes or variables based on Collection Domains or variables defined as collection with the same data type of the left operand.

Description

When the right operand is a list of constants delimited by comma, the IN operand is equivalent to the expression: LeftOperand = FirstConstant OR LeftOperand = SecondConstant ...

When the right operand is a Collection or Array, the semantic is the same, but the list varies depending on the elements the Collection or Array has in that specific execution.

In the case of In DataSelectors see Data Selectors in For Each command

Associated specification messages and controls:

  • spc0075: Operand %1 does not match the data type of %2 in the IN comparison.
     
  • spc0076: %1 must be a collection to be used as the right operand in an IN comparison.
     
  • spc0077: %1's data type (%2) is not supported in an IN comparison.

Note: The IN with Collection or Array has not been rightly generated so far.

Examples

If &element in &Collection
    ...
EndIf
For Each
    where Attribute in &Collection
    ...
EndFor
For Each
    where Attribute in DataSelector
    ...
EndFor

Considerations

Note that the first operand can only be an Attribute or Variable, not an expression (i.e "&numValue.ToString() IN &CharCollection " is not supported). 

See also