Help Center
Help CenterFreeBASIC

Arraylenfunction

Provides the length of an array given its array-name.

Array Functionsfunctiondocumented

Syntax

Declare Function ArrayLen ( arrayname() As Const Any ) As UInteger

Parameters

NameDescription
arraynameThe name of the array for which the length is returned.

Description


Returns the total number of elements of the array specified by arrayname() (taking into account all dimensions of array).

Remarks

Usage


#include once "fbc-int/array.bi"
using FB
...
result = ArrayLen(arrayname())

Version


  • Since fbc 1.09.0.

Differences from QB


  • New to FreeBASIC.

See also


Example


#include Once "fbc-int/array.bi"

Using FB



Dim As LongInt array(4, 5)

Dim As UInteger array_length



array_length = ArrayLen(array())

Print array_length                '' 30

Reference

  • Documented in KeyPgArrayLen.html