mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-05 11:15:09 +02:00
The syntax is listed in the ngspice manual, chapter 17.6 Control Structures. Practical examples using a simple voltage divider circuit are given here.
16 lines
195 B
Plaintext
16 lines
195 B
Plaintext
example foreach loop
|
|
.control
|
|
|
|
foreach val -40 -20 0 20 40
|
|
echo var is $val
|
|
end
|
|
echo
|
|
set myvariable = ( -4 -2 0 2 4 )
|
|
foreach var $myvariable
|
|
echo var is $var
|
|
end
|
|
|
|
.endc
|
|
|
|
.end
|