String TableΒΆ

This domain provides a table type in which the keys are known to be strings so special techniques can be used. Other than performance, the type StringTable(S) should behave exactly the same way as Table(String,S).

This creates a new table whose keys are strings.

t: StringTable(Integer) := table()
  table()
                             Type: StringTable Integer

The value associated with each string key is the number of characters in the string.

for s in split("My name is Ian Watt.",char " ")
  repeat
    t.s := #s
                             Type: Void

for key in keys t repeat output [key, t.key]
 ["Watt.",5]
 ["Ian",3]
 ["is",2]
 ["name",4]
 ["My",2]
                             Type: Void

See Also:

  • )help Table
  • )show StringTable

Table Of Contents

This Page