Returns the index of the last occurrence of an element.
List.bdh
ListLastIndexOf( in theList: list, in element: union): number;
Parameter | Description |
---|---|
theList | List of number, boolean, float or string. |
element | Number, boolean, float or string. Has to conform with the type of theList. |
transaction TAListLastIndexOf var lstNumber: list of number init 1, 2, 333, 4, 5, 333; retVal: number; begin retVal := ListLastIndexOf(lstNumber, 333); writeLn("index of 333: " + string(retVal)); ListRemoveAt(lstNumber, 6); retVal := ListLastIndexOf(lstNumber, 333); writeLn("index of 333: " + string(retVal)); end TAListLastIndexOf;
index of 333: 6 index of 333: 3