Get the index of the last occurrence Version 11 (Java)

Action group: Collections


Description

The action returns the index of the last occurrence.

Action icon

Parameters

Input parameters

ParameterDescription
ListThe list for processing. 
ValueThe value for checking.

Output parameters

Index - a numeric variable containing the index of the element with the specified value, or -1 if the element is not found.

Settings of parameters

Property

Description

Type

Filling example

Mandatory

Parameters

List

List for processing.

Robin.Collection


yes

Value

Value for checking.

Robin.Object


yes

Results

Index

A numeric variable containing the index of the element with the specified value, or -1 if the element is not found.

Robin.Numeric



Special conditions of use

None. 

Example of use

Task

You have a "Collection 1" variable with the values of cities. Get the index of the last occurrence of the "Moscow" element. 

Solution

Use the "Get the index of the last occurrence" action.

Implementation 

  1. Move the "Get the index of the last occurrence" action to the workspace.


  2. Set the "Get the index of the last occurrence" action parameters. 


  3. Start the robot by clicking "Start" in the top panel.

Result

The index of the last occurrence of the "Moscow" element was obtained.

  • Нет меток