EasyManuals Logo
Home>Keithley>Measuring Instruments>2601

Keithley 2601 Reference Manual

Keithley 2601
562 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 #98 background imageLoading...
Page #98 background image
2-50 Return to Section Topics 2600S-901-01 Rev. C / January 2008
Section 2: TSP Programming Series 2600 System SourceMeter® Instruments Reference Manual
Branching
TSL uses the “if” keyword to do conditional branching.
--
-------------------------------- IF blocks ------------------------
--
if 0 then -- Zero IS true! This is a contrast to C where 0 evaluates
print("Zero is true!") false. In TSL, “nil” is false and everything else is true.
else
print("Zero is false.")
end -- if expression 1.
x = 1
y = 2
if (x and y) then
print("' if ' expression 2 was not false.")
end -- if expression 2.
if (x or y) then
print("' if ' expression 3 was not false.")
end -- if expression 3.
if (not x) then
print("' if ' expression 4 was not false.")
else
print("' if ' expression 4 was false.")
end -- if expression 4.
if x == 10 then
print("x = 10")
elseif y > 2 then
print("y > 2")
else
print("x is not equal to 10, and y is not less than 2.")
end -- if expression 5.
Output of code above:
Zero is true!
' if ' expression 2 was not false.
' if ' expression 3 was not false.

Table of Contents

Other manuals for Keithley 2601

Questions and Answers:

Question and Answer IconNeed help?

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

Keithley 2601 Specifications

General IconGeneral
BrandKeithley
Model2601
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals