EasyManuals Logo

Keithley SourceMeter 2612 Reference Manual

Keithley SourceMeter 2612
594 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 #112 background imageLoading...
Page #112 background image
2-60 TSP Programming Fundamentals Series 2600 System SourceMeters Reference Manual
2600S-901-01 Rev. A / May 2006 Return to Section 2 topics
Loop control
TSL has familiar constructs for doing things repetitively and/or until an expression
evaluates to false.
Something to iterate
list = {"One", "Two", "Three", "Four", "Five", "Six"}
--
-------------------------------- FOR loop ----------------------------
--
print("Counting from one to three:")
for element = 1, 3 do
print(element, list[element])
end
print("Counting from one to four,")
print("in steps of two:")
for element = 1, 4, 2 do
print(element, list[element])
end
--
-------------------------------- WHILE loop --------------------------
--
print("Count elements in list")
print("on numeric index")
element = 1
while list[element] do -- Will exit when list[element] = nil
print(element, list[element])
element = element + 1
end
--
-------------------------------- REPEAT loop -------------------------
--
print("Count elements in list")
print("using repeat")
element = 1
repeat
print(element, list[element])
element = element + 1
until not list[element]
Output of code above:
Counting from one to three:
1 One
2 Two
3 Three

Table of Contents

Other manuals for Keithley SourceMeter 2612

Questions and Answers:

Question and Answer IconNeed help?

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

Keithley SourceMeter 2612 Specifications

General IconGeneral
BrandKeithley
ModelSourceMeter 2612
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals