Next / Previous / Index / TCC Help System / Publications / Site map / NM Tech homepage

Testing an Icon table for the presence of a key

Tech Computer Center logo

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').

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, "!" );

Next: Creating your own record types in Icon
See also: Using the table type in Icon
Previous: Retrieving items from an Icon table
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Computer Center: Help System
TCC Publications
Home: About New Mexico Tech

John Shipman, john@nmt.edu

Last updated: 1998/02/08 23:17:55 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/isintable.html