FOREACH
Loop:
FOREACH
loop is used to iterate over all of the
elements in a given object/file.
FOREACH <item> <func> <in> ... ENDFOR
FOREACH
command supports a number of functions applicable
to a variety of object/file types.
Function | Iterate Over |
---|---|
INDF | Each element in a Midas DataFile |
INFILE | Alias for INDF |
INLIST | Each element in a comma separated list |
INSIZE | Iterate for IN=<size> |
INTABLE | Each key in a Table or KeyVector |
INTABLE/V | Each value in a Table or KeyVector |
INTF | Each line in a TextFile |
INKW | Each keyword in a DataFile with scope |
IN | Each item in a Java object (Collection, Map, array, etc.) |
IN/V | Each value in a Java Map object |
foreach key INTABLE mytable say "Key ^key = ^mytable.^key" endfor foreach kwi INKW myfile.tmp /scope=tag=alias say "Next Key: ^kwi.name Value: ^kwi.value" endfor
FOREACH
explain file for more details.Iteration |
---|
The generic IN and IN/V functions allow you to iterate over
a large number of Java objects.
|