News flash: I'm going to Australia in February, so this Web site may be switched off at any time.


Storing field values in an Icon record

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: Using the Icon programming language
Previous: Creating an Icon record object

John W. Shipman, john@nmt.edu