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

Storing items in an Icon table

Tech Computer Center logo

To store value v into an Icon table named t under the key value k:

    t[k]  :=  v;
For example, this code sets up a table for translating the three-letter string for the day of the week to a number:
    dayNumbers  :=  table ( );     # Create the table
    dayNumbers["Sun"]  :=  1;
    dayNumbers["Mon"]  :=  2;
    dayNumbers["Tue"]  :=  3;
    dayNumbers["Wed"]  :=  4;
    dayNumbers["Thu"]  :=  5;
    dayNumbers["Fri"]  :=  6;
    dayNumbers["Sat"]  :=  7;

Next: Retrieving items from an Icon table
See also: Using the table type in Icon
Previous: Creating an Icon table
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 1996/01/06 21:12:57 UT
QR two-dimensional bar code