Skip to content

Modern Array Count

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Array › Array Container › Count

Count

Returns the number of elements; the valid indices are 0 to Count minus 1.

Syntax

Count( ) as int32

Examples

#import "std/containers"
using containers

dim v as Array( of ustring )
print v.Count            '' 0

v.Push( "a" ) : v.Push( "b" )
print v.Count            '' 2

'' The valid indices are 0 to Count-1
for i as int32 = 0 to v.Count - 1
    print i & ": " & v[ i ]
next

Library: Array Container
Category: Array
Documented under: Members

Clone this wiki locally