Retrieving items from an Icon table |
|
Once you have stored a value v into a table t using key k, you can retrieve the stored value using this expression:
t[k]
For example, if the variable ``today'' contains the
three-letter string for the day of the week, and you have a table
``dayNumbers'' set up as shown in the previous page (see
`Storing items in an Icon table'), the expression
dayNumbers[today]
will return the value stored under that key. If
``today'' is the string "Tue", the expression
``dayNumbers[today]'' will produce the integer 3.