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

Creating an Icon record object

Tech Computer Center logo

Once you have defined the fields that go into a given record type (see `Declaring an Icon record type'), you can create one record of that type by using the record's name followed by parentheses.

For example, suppose your program contains this declaration:

    record complex ( r, i )
This expression would create a record of type ``complex'' and store it in variable ``x'':
    x  :=  complex ( );
If you wish, you can supply initial values for the fields by placing them inside the parentheses. For example, this expression
    y  :=  complex ( 0, 5.9 );
would set ``y'' to a record of type ``complex'' whose ``r'' field would contain the integer 0 and whose ``i'' field would contain the real number 5.9.
Next: Storing field values in an Icon record
See also: Creating your own record types in Icon
Previous: Declaring an Icon record type
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