File: loop_IfThenElse.cir

package info (click to toggle)
ngspice 44.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 73,372 kB
  • sloc: ansic: 560,757; cpp: 17,623; xml: 9,372; makefile: 4,076; sh: 2,664; perl: 2,442; yacc: 1,549; tcl: 1,040; lex: 320; pascal: 241; python: 179
file content (19 lines) | stat: -rw-r--r-- 302 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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