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

Creating an Icon list with specific contents

Tech Computer Center logo

To create a list in the Icon language, simply enclose the elements of the list in square brackets, separated by commas. For example, this expression sets the variable ``flapper'' to a list with two elements, the integer 23 and the string "skiddoo":

    flapper  :=  [ 23, "skiddoo" ];
As another example, this expression sets the variable ``perfectPeople'' to an empty list:
    perfectPeople  :=  [ ];
Here, the variable ``array'' is set to a list containing two lists of three integers each:
    array  :=  [ [1, 3, 5], [2, 4, 6] ];

If you want to set up a list with a lot of elements all at once, see `Creating an Icon list of a fixed size'.

Next: Creating an Icon list of a fixed size
See also: Using the list type in Icon
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