Index
listof type name = {value, ...}
Declare a variable that will contain a list of values of a given type.
- Arguments:
-
-
type name
- The type of list and the name to give it.
-
value
- One of the values to include in the initial contents of the
list.
Note that if you already have a list of the same type,
you can assign this directly to the new list variable.
- Example:
- The following example creates a list of sources and observes each
of them in turn for 1 minute.
listof Source sl = {3c345, 3c273, 0552+398}
foreach(Source s) $sl {
track $s
until $elapsed >= 1m
}
- Context:
- Lists are primarily intended for use with
foreach loops. They allow one
to iterate a set of commands over a given selection of values. The
above example is limited, because only one thing is being listed,
but with lists of group
datatypes one can extend this to lists of many items.
Martin Shepherd (9-Oct-1997)