Section 6: Instrument programming
Model 2651A High Power System SourceMeter® Instrument Reference Manual
6-24
2651A-901-01 Rev. A / March 2011
Example: If
if 0 then
print("Zero is true!")
else
print("Zero is false.")
end
Zero is true!
Example: Comparison
x = 1
y = 2
if x and y then
print("Both x and y are true")
end
Both x and y are true
Example: If and else
x = 2
if not x then
print("This is from the if block")
else
print("This is from the else block")
end
This is from the else
block