This example program writes its arguments
$ include "seed7_05.s7i";
const proc: main is func
var string: stri is "";
for stri range argv(PROGRAM) do
write(stri <& " ");
The keyword 'local' introduces local declarations.
In this case the string variable 'stri' is declared
and initialized with "", the empty string literal.
The function argv(PROGRAM) returns the program arguments as array of strings.
The 'for' (for-each) loop iterates over all elements of this array.
The for-each statement is overloaded for various collection types.
The <& operator is used to concatenate elements before writing. If one operand of
the <& operator has not the type string it is converted to
a string using the 'str' function.