Difference between revisions of "Arrays.AddRowAt"

From Xojo Documentation

 
Line 8: Line 8:
 
}}
 
}}
 
{{Description
 
{{Description
|text = Adds a new row to the end of a one-dimensional array, increasing the size of the array by one. The value must match the data type of the array. }}
+
|text = Adds a new row into an array at the specified ''index''. }}
  
 
== Usage ==
 
== Usage ==
 
''array''.'''AddRowAt''' ''index'', ''value''
 
''array''.'''AddRowAt''' ''index'', ''value''
 
{| class="genericTable"
 
{| class="genericTable"
 
 
! width=15% | Part
 
! width=15% | Part
 
 
! width=15% | Type
 
! width=15% | Type
 
 
! width=55% | Description
 
! width=55% | Description
 
|-
 
|-
 
|array
 
|array
 
 
|array of any valid data type
 
|array of any valid data type
 
 
|The array in which to add the new row.
 
|The array in which to add the new row.
 
 
|-
 
|-
 
|index
 
|index
 
 
|[[Integer]]
 
|[[Integer]]
 
|The index in ''array'' to add the new row.
 
|The index in ''array'' to add the new row.
 
 
|-
 
|-
 
|value
 
|value
 
 
|Datatype of ''array''
 
|Datatype of ''array''
 
|The value to be assigned to the new array row.
 
|The value to be assigned to the new array row.
 
 
|-
 
|-
 
|}
 
|}

Latest revision as of 19:40, 4 December 2019

Method

Arrays.AddRowAt(index As Integer, value As DataType)

New in 2019r2

Supported for all project types and targets.

Adds a new row into an array at the specified index.

Usage

array.AddRowAt index, value

Part Type Description
array array of any valid data type The array in which to add the new row.
index Integer The index in array to add the new row.
value Datatype of array The value to be assigned to the new array row.

Notes

The AddRowAt method works with one-dimensional arrays only.

Arrays can have a maximum index value of 2,147,483,646.

Sample Code

Consider the array names defined as follows:

names = Array("Leonard", "Abraham", "Herbert")

The statement:

names.AddRowAt(2, "Bill")

results in the following array:

names
Leonard
Abraham
Bill
Herbert

See Also

Arrays for a complete list of functions.