Dynamic array methods

These methods are used to manipulate variables of a DYNAMIC ARRAY data type (e.g., to add and remove array elements).  

Most methods described here can be applied only to one-dimensional dynamic arrays (only few of them can also be used with multi-dimensional arrays).

Dynamic arrays are resized automatically when elements are assigned values and their size corresponds to the largest element index.

Dynamic array methods  are invoked in this way:

DEFINE ar DYNAMIC ARRAY OF CHAR(15)

CALL ar.<Method>(<parameters>)

Some methods have two variants. They differ in the method name and/or its parameters.

Available methods

append()

adds a new element after the last element of the array

appendElement()

adds a new element with the NULL value to the array (takes no parameters)

insert()

inserts a new array element to the specified position (the value of a new element is passed as one of the method parameters)

insertElement()

inserts an empty array element to the specified position

resize()

resizes the single-dimensional array to the specified size

getSize()

returns the size of a single-dimensional array

getLength()

returns the length of a single-dimensional array

delete()

removes all the specified array elements within the given range or at the given position

deleteElement()

removes the specified array element

clear()

removes all the elements

join()

concatenates all the elements of an array into a string

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.