arraysize(
arraysize(
TEXT
,
SEPARATOR
)

The arraysize( function returns the number of elements in a text array or a data array (see Text Arrays and Data Arrays).

Parameters

This function has two parameters:

text – The array whose elements you want to count.

separator – The separator character for this array. This parameter is omitted if the target array is a data array.

Description

This function returns the number of elements in the specified array. If a text array is empty, the function will return a result of “1” (it interprets the array as having one empty element). If a data array is empty, the function returns a result of zero.

    arraysize("Red,Green,Blue",",") ☞ 3
    arraysize("Red",",") ☞ 1
    arraysize("",",") ☞ 1
    arraysize(",,",",") ☞ 3
    arraysize("sun/mon/tue/wed/thu/fri/sat","/") ☞ 7

#### Working with Data Arrays

This function works with both data and text arrays. Because Data Arrays have no separators between elements, the separator parameter is omitted when targeting a data array.

The arraysize( function works much as it does for text arrays except that the size of an empty data array is reported as zero.

    arraysize(dataarray(2,0.7,18,5.12,360)) ☞ 5
    arraysize(dataarray()) ☞ 0

See Also

- array( -- extracts a single data item from a text array or a data array (see Text Arrays and Data Arrays).
- arrayelement( -- converts between character positions and array element numbers in a text array.
- arrayrange( -- extracts a series of data items from a text array or a data array (see Text Arrays and Data Arrays).
- arraysearch( -- searches a text array or a data array (see Text Arrays and Data Arrays) to see if it contains a specific value.
- extract( -- extracts a single data item from a text array, and can also be used to count the number of items in the array.
- Text Arrays -- A numbered collection of text values.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0