Skip to content

Modern Map Put

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

Home › Map › Map › Put

Put

Stores a value under a key, replacing any old one; returns true if the key was new.

Syntax

Put( k, v ) as boolean

Examples

#import "std/containers"
using containers

dim ages as Map( of ustring, integer )

print ages.Put( "ada", 36 )      '' true -- the key was new
print ages.Put( "ada", 37 )      '' false -- existed, and was OVERWRITTEN
print ages[ "ada" ]              '' 37

'' Add is the same call that refuses to overwrite

Library: Map
Category: Map
Documented under: Members

Clone this wiki locally