EasyManuals Logo

Keithley 3700 Series User Manual

Keithley 3700 Series
936 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #334 background imageLoading...
Page #334 background image
Series 3700A System Switch/Multimeter Reference Manual Section 10: Instrument programming
3700AS-901-01 Rev. D/June 2018 10-23
Conditional branching
Lua uses the if, else, elseif, then, and end keywords to do conditional branching.
Note that in Lua, nil and false are false and everything else is true. Zero (0) is true in Lua.
The syntax of a conditional block is as follows:
if expression then
block
elseif expression then
block
else
block
end
Where:
• expression is Lua code that evaluates to either true or false
• block consists of one or more Lua statements
Example: If
if 0 then
print("Zero is true!")
else
print("Zero is false.")
end
Output:
Zero is true!
Example: Comparison
x = 1
y = 2
if x and y then
print("Both x and y are true")
end
Output:
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
Output:
This is from the else
block

Table of Contents

Other manuals for Keithley 3700 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keithley 3700 Series and is the answer not in the manual?

Keithley 3700 Series Specifications

General IconGeneral
BrandKeithley
Model3700 Series
CategoryMultimeter
LanguageEnglish

Related product manuals