RosettaCodeData/Task/Associative-array-Creation/Objeck/associative-array-creation-2.objeck

11 lines
383 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# create map
map := StringHash->New();
# insert
map->Insert("two", IntHolder->New(2)->As(Base));
map->Insert("thirteen", IntHolder->New(13)->As(Base));
map->Insert("five", IntHolder->New(5)->As(Base));
map->Insert("seven", IntHolder->New(7)->As(Base));
# find
map->Find("thirteen")->As(IntHolder)->GetValue()->PrintLine();
map->Find("seven")->As(IntHolder)->GetValue()->PrintLine();