Explorar o código

Added map operator examples.

woollybah %!s(int64=6) %!d(string=hai) anos
pai
achega
fe8b2de784

+ 13 - 0
map.mod/doc/tintmap_operator_iget.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TIntMap = New TIntMap
+
+map.Insert(1, "Hello")
+map.Insert(2, "World")
+
+For Local k:TIntKey = EachIn map.Keys()
+	Print k.value + " = " + String(map[k.value]) ' retrieve value using index operator
+Next

+ 13 - 0
map.mod/doc/tintmap_operator_iset.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TIntMap = New TIntMap
+
+map[1] = "Hello" ' insert value using index operator
+map[2] = "World"
+
+For Local k:TIntKey = EachIn map.Keys()
+	Print k.value + " = " + String(map.ValueForKey(k.value))
+Next

+ 13 - 0
map.mod/doc/tmap_operator_iget.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TMap = New TMap
+
+map.Insert("one", "Hello")
+map.Insert("two", "World")
+
+For Local s:String = EachIn map.Keys()
+	Print s + " = " + String(map[s]) ' retrieve value using index operator
+Next

+ 13 - 0
map.mod/doc/tmap_operator_iset.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TMap = New TMap
+
+map["one"] = "Hello" ' insert value using index operator
+map["two"] = "World"
+
+For Local s:String = EachIn map.Keys()
+	Print s + " = " + String(map.ValueForKey(s))
+Next

+ 13 - 0
map.mod/doc/tptrmap_operator_iget.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TPtrMap = New TPtrMap
+
+map.Insert(Byte Ptr(1), "Hello")
+map.Insert(Byte Ptr(2), "World")
+
+For Local k:TPtrKey = EachIn map.Keys()
+	Print Int(k.value) + " = " + String(map[k.value]) ' retrieve value using index operator
+Next

+ 13 - 0
map.mod/doc/tptrmap_operator_iset.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TPtrMap = New TPtrMap
+
+map[Byte Ptr(1)] = "Hello" ' insert value using index operator
+map[Byte Ptr(2)] = "World"
+
+For Local k:TPtrKey = EachIn map.Keys()
+	Print Int(k.value) + " = " + String(map.ValueForKey(k.value))
+Next

+ 13 - 0
map.mod/doc/tstringmap_operator_iget.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TStringMap = New TStringMap
+
+map.Insert("one", "Hello")
+map.Insert("two", "World")
+
+For Local s:String = EachIn map.Keys()
+	Print s + " = " + String(map[s]) ' retrieve value using index operator
+Next

+ 13 - 0
map.mod/doc/tstringmap_operator_iset.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+
+Framework brl.standardio
+Import brl.map
+
+Local map:TStringMap = New TStringMap
+
+map["one"] = "Hello" ' insert value using index operator
+map["two"] = "World"
+
+For Local s:String = EachIn map.Keys()
+	Print s + " = " + String(map.ValueForKey(s))
+Next