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

Storing field values in an Icon record

Tech Computer Center logo

To set one field f of a record r to a given value v, simply say

    r.f  :=  v;

For all practical purposes, a record is stored as a list. Thus, you can also store values in a field by using

    r[k]  :=  v;
where r is the record and k is the position of the field within the record, counting from 1. For example, assuming you have declared the ``complex'' type (see `Declaring an Icon record type'), you could set the imaginary part of a complex number x to zero either by:
    r.i  :=  0;
or by:
    r[2]  :=  0;

Next: Retrieving field values from an Icon record
See also: Creating your own record types in Icon
Previous: Creating an Icon record object
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 22:59:17 UT
QR two-dimensional bar code