Skip to content

Modern Map Keys

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

Home › Map › Map › Keys

Keys

Returns a copy of all the keys as an Array, in no particular order.

Syntax

Keys( ) as Array( of K )

Examples

#import "std/containers"
using containers

dim ages as Map( of ustring, integer )
ages.Put( "ada", 36 )
ages.Put( "grace", 45 )

'' A snapshot, as an Array -- not a live view of the map
dim ks as Array( of ustring ) = ages.Keys( )
print ks.Count                   '' 2

'' ITERATION ORDER IS UNSPECIFIED, so sort before printing if the
'' output has to be reproducible

Library: Map
Category: Map
Documented under: Members

Clone this wiki locally