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

Using Icon lists as arrays

Tech Computer Center logo

You can refer to the elements of an Icon list by their position in the list, in much the same way that you can refer to the characters of a string (see `How Icon positions are numbered'). For example, this expression writes the second element of list ``L'' to the program's standard output:

    write ( L[2] );
Similarly, you can set any element of a string by assigning a value to a subscripted element of a list. This expression sets the 9th element of list L to 8.5:
    L[9]  :=  8.5;

Next: Using Icon lists as stacks
See also: Using the list type in Icon
Previous: Finding the size of an Icon list
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Computer Center: Help System
TCC Publications
Home: About New Mexico Tech

John Shipman, john@nmt.edu

Last updated: 1996/01/06 21:12:57 UT
URL: http://www.nmt.edu/tcc/help/lang/icon/arraylist.html