News flash: I'm going to Australia in February, so this Web site may be switched off at any time.
If you try to retrieve an item from a table using a particular key value, and nothing has ever been stored under that value, the result depends on how you created the table (see creating an Icon table).
table(x)
'',
you will get the value x.
table()
'' with no arguments to create
the table, you will get a null value. You can use the
``/
'' and ``\
'' operators to test for this
value (see
how does the null value work in Icon?).
For example, if you have created the ``dayNumbers
''
array (see
storing items in an Icon table),
this code would stop the program if there is no entry for the
day with name ``today
'':
if / dayNumbers[today] then stop ( "Argh! There's no such day as ", today, "!" );
john@nmt.edu