The values used in the foreach loop my be given by a vector

(in addition to plain numbers or a list variable).
This commit is contained in:
Holger Vogt 2024-03-19 16:41:27 +01:00
parent e27f093fb7
commit 92b3a901c7
1 changed files with 8 additions and 0 deletions

View File

@ -1,14 +1,22 @@
example foreach loop
.control
* set values by numbers
foreach val -40 -20 0 20 40
echo var is $val
end
echo
*set values by variable
set myvariable = ( -4 -2 0 2 4 )
foreach var $myvariable
echo var is $var
end
echo
* set values by vector
let myvec = vector(5)
foreach var $&myvec
echo var is $var
end
.endc