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

Retrieving field values from an Icon record

Tech Computer Center logo

The notation ``r.f'' refers to field f of record r. For example, assuming you have declared the ``complex'' type (as in `Declaring an Icon record type'), you can write the imaginary part of a complex number x using:

    write ( x.i );

Since a record in Icon is functionally identical to a list of the fields, you can also access the nth field of a record f as ``f[n]''.

For example, this expression writes all the fields of a record r:

    every write ( ! r );
See `Generating the elements of an Icon list' for more information about the ``!'' operator.
Next: Passing data structures to Icon procedures
See also: Creating your own record types in Icon
Previous: Storing field values in an Icon record
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: 1998/02/08 23:17:45 UT
QR two-dimensional bar code