EasyManuals Logo

Keithley 3730 Reference Manual

Keithley 3730
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 #336 background imageLoading...
Page #336 background image
Series 3700A System Switch/Multimeter Reference Manual Section 10: Instrument programming
3700AS-901-01 Rev. D/June 2018 10-25
Example: While
list = {
"One", "Two", "Three", "Four", "Five", "Six"}
print("Count list elements on numeric index:")
element = 1
while list[element] do
print(element, list[element])
element = element + 1
end
This loop exits when list[element]
= nil.
Output:
Count list elements on
numeric index:
1 One
2 Two
3 Three
4 Four
5 Five
6 Six
Repeat until loops
To repeat a command, you use the repeat ... until statement. The body of a repeat statement
always executes at least once. It stops repeating when the conditions of the until clause are met.
repeat
block
until expression
Where:
• block consists of one or more Lua statements
• expression is Lua code that evaluates to either true or false
The output you get from this example may vary depending on the data format settings of the
instrument.
Example: Repeat until
list = {"One", "Two", "Three", "Four", "Five", "Six"}
print("Count elements in list using repeat:")
element = 1
repeat
print(element, list[element])
element = element + 1
until not list[element]
Output:
Count elements in list
using repeat:
1 One
2 Two
3 Three
4 Four
5 Five
6 Six

Table of Contents

Other manuals for Keithley 3730

Questions and Answers:

Question and Answer IconNeed help?

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

Keithley 3730 Specifications

General IconGeneral
BrandKeithley
Model3730
CategoryMultimeter
LanguageEnglish

Related product manuals