Skip to content

Modern OrderedMap Count

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

Home › OrderedMap › OrderedMap and OrderedSet › OrderedMap.Count

OrderedMap.Count

Returns the number of entries; reading an absent key with m[ k ] adds one.

Syntax

Count( ) as int32

Examples

#import "std/containers"
using containers

dim ages as OrderedMap( of ustring, integer )
print ages.Count                  '' 0

ages.Put( "ada", 36 )
ages.Put( "ada", 37 )             '' an overwrite, not an insertion
print ages.Count                  '' 1

print ages[ "nobody" ]            '' 0 -- and the read INSERTED it
print ages.Count                  '' 2

Library: OrderedMap and OrderedSet
Category: OrderedMap
Documented under: Members

Clone this wiki locally