list class : Find(class,int) method

Description

It stores the first child that matches as a value in the proxy and returns it.

Syntax

listInstance.Find(class searchInstance, int startIndex)

Arguments

ClassNameDescription
classsearchInstanceAn instance to search as value.
intstartIndexA start position of searching.

Return value

ClassDescription
proxyA proxy with child element that match as a value.

Sample code

1:

list{string} stringList = new list{string}();

2:

stringList.Add("a");

3:

stringList.Add("b");

4:

stringList.Add("a");

5:

proxy resultProxy = stringList.Find("a", 1); // The result (resultProxy) has the last child of the list.

Notes

This method returns a first child itself that match as value.

If there is no element that matches as a value, an empty proxy is returned.

The first argument must be the int, long, real, string, or bool. It is meaningless in other types.

This method searches from the specified position toward the end of the list.

UnknownException (ArgumentOutOfOfRangeException) is thrown if the second argument is less than zero or greater than or equal to the number of elements in the list.

Links for reference

None

Copyright © Rice All rights reserved.