Section9.78

]>
Book Contents Previous Section 9.77 String Next Section 9.79 Symbol Book Index

## 9.78 StringTable

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). See TableXmpPage for general information about tables.

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
Void
for key in keys t repeat output [key, t.key]
["Ian",3]
["My",2]
["Watt.",5]
["name",4]
["is",2]
Void
Book Contents Previous Section 9.77 String Next Section 9.79 Symbol Book Index