Files
ngspice/examples/loops/loop_IfThenElse.cir
T
Holger Vogt 6b03aaa15f examples for loops.
The syntax is listed in the ngspice manual,
chapter 17.6 Control Structures. Practical examples
using a simple voltage divider circuit are given here.
2022-04-26 10:32:53 +02:00

20 lines
302 B
Plaintext

example if then else loop
.control
foreach val -40 -20 0 20 40
if $val < 0
echo variable $val is less than 0
else
echo variable $val is greater than or equal to 0
end
end
let vec = 1
if vec = 1 ; $&vec = 1 is possible as well
echo vec is $&vec
end
.endc
.end