| Maptitude GISDK Help |
Finds the position of a sub-array in an array.
position = ArrayPosition(array my_array, array sub_array, array options)
| Argument | Contents |
|---|---|
| my_array | The array to be searched |
| sub_array | The sub-array to locate |
| Option | Type | Contents |
|---|---|---|
| Case Sensitive | Boolean | If "True" the comparison is case sensitive, if "False" (the default) the comparison is not case sensitive |
An integer indicating the position of the first occurrence of sub_array in my_array, or zero, indicating that sub_array does not appear in my_array.
my_array must consist of integers, real values, and strings.
ArrayPosition() does not compare nested arrays.
If sub_array matches the beginning of my_array, returns one.
pos = ArrayPosition({1, 2, 3, 4, 5}, {4, 5}, ) // pos = 4
pos = ArrayPosition({"Fred"}, {"fred"}, {{"Case Sensitive", "True"}}) // pos = 0
pos = ArrayPosition({"Bill", "Fred", "Sam"}, {"Mark"}, ) // pos = 0
| Function | Summary |
|---|---|
| Subarray() | Extracts a number of elements from an array |
| FindStrings() | Finds strings in an array that match one or more search specs |
| ©2025 Caliper Corporation | www.caliper.com |