Maptitude GISDK Help |
Computes the number of elements in an array.
len = ArrayLength(array input_array)
Argument |
Contents |
input_array |
Any array |
An integer containing the number of elements in the array.
ArrayLength() counts the elements in an array regardless of their type. It can be used on arrays whose elements are of mixed type.
If the array is null, ArrayLength() returns zero.
ArrayLength() counts only the top-level elements in the array. If the array contains sub-arrays, each sub-array is considered one element; ArrayLength() does not count the number of elements in sub-arrays.
// Two ways to get the length of an array...
x = {"Fred", 243.5, {1, 2, 3}, "Last Item"}
l1 = ArrayLength(x) // l1 is equal to 4
l2 = x.length // l2 is equal to 4, too
// Here's a very common type of loop
maps = GetMapNames()
for i = 1 to ArrayLength(maps) do // or, for i = 1 to maps.length
// do something to the map...
end
Error Type |
Meaning |
Error |
The argument is not an array |
Function |
Summary |
Finds the position of a sub-array in an array |
|
Extracts a number of elements from an array |
©2025 Caliper Corporation | www.caliper.com |