Using Icon lists as arrays |
|
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;
|
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 |
|