Skip to content

Modern Array Array

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

Home › Array › Array Container › Array

Array

Holds a growable list of values in order, reached by position from 0.

Syntax

Array( of Array( of int32 ) )

Examples

#import "std/containers"
using containers

'' A growable array. Indices are ZERO-based -- a deliberate break with
'' `dim arr(1 to 10)` tradition, because Count and index arithmetic are
'' otherwise a permanent source of off-by-one.
dim v as Array( of ustring )

v.Push( "ada" )
v.Push( "grace" )

print v.Count            '' 2
print v[ 0 ]             '' ada

'' Copy and assignment are DEEP -- pass containers byref where it matters
dim w as Array( of ustring ) = v
w[ 0 ] = "alan"
print v[ 0 ] & " " & w[ 0 ]      '' ada alan

Library: Array Container
Category: Array
Documented under: Why Sort, Indexof And Contains Are Not Members

Clone this wiki locally