FANDOM



This command will return the number of items in the array.

Syntax
Return Integer=ARRAY COUNT(Array Name(0))
Parameters
Array Name(0)

Integer
The name of the array followed by a pair of brackets ( ). You can also insert a value of zero, i.e. arrayname(0)

Returns

This value is an integer number such as 1.

Description

This is usually the value used to create the array when the DIM command was used, however by modifying the dynamic array this value can change throughout the execution of the program. When an array is completely empty, it will return a count of -1. The count refers to the number of available indexes, and so will return a count of zero when the command DIM arr(0) is used, representing the fact a single subscript is available at index zero.

Example Code
DIM array(0)

FOR T=1 TO 5

ARRAY INSERT AT BOTTOM array()

NEXT T

PRINT ARRAY COUNT(array())

WAIT KEY
Community content is available under CC-BY-SA unless otherwise noted.