Returns the index associated to an SDT item in an SDT collection.
It must be a variable based on an SDT collection (or a variable based on a simple SDT and defined as a collection).
Variable based on an SDT item.
Java, Ruby (up to GeneXus X Evolution 3)
It returns the index (a numeric value) associated with the Item parameter element of an SDT collection.
In general, the IndexOf method of an SDT Collection is used in conjunction with the Remove method. Once you have the desired index (position in the SDT), you can use the associated Remove method.
&index = &sdtCollection.IndexOf(&sdtCollection.CurrentItem)
This method works with the elements' references and not with their contents. This implies that if a variable with a list of SDT is received as a parameter and a temporary variable is loaded with an item content, IndexOf will return 0 (empty) since this reference is not within the list. It can be useful only in the moment the list is loaded.
Structured Data Type methods