Maptitude GISDK Help

Subarray()

Summary

Extracts a number of elements from an array.

 

Syntax

sub_array = Subarray(array my_array, integer start, integer count)

 

Argument Contents
my_array The input array
start The position of the first element extracted
count The number of elements extracted

 

Returns

An array containing the specified elements of my_array, or null, if start and count do not specify any elements.

 

Notes

Example

array1 = {1, 2, {3, 4, 5}, {6, 7}, 8, 9}

sub = Subarray(array1, 4, 2) // sub = {{6, 7}, 8}

x = Subarray(x, 1, 3) // extracts the first three elements of x

 

Error Codes

Error Type Meaning
Error Start is less than one, or count is less than zero

 

See Also

Function Summary
ArrayPosition() Finds the position of a sub-array in an array
CopyArray() Makes a copy of the array, including nested sub-arrays, to any depth
ExcludeArrayElements() Removes elements from an array
ExtractArray() Returns the specified sub-array, which must itself be an array
FindStrings() Finds strings in an array that match one or more search specs
InsertArrayElements() Inserts elements into an array

 

 

©2025 Caliper Corporation www.caliper.com