Next / Previous / Index / ITC 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 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