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 #95 background imageLoading...
Page #95 background image
2600S-901-01 Rev. C / January 2008 Return to Section Topics 2-47
Series 2600 System SourceMeter® Instruments Reference Manual Section 2: TSP Programming
print(ratio)
Output of code above:
7
12
5
-1
0.66666
Tables/arrays
TSL makes extensive use of the data type “table,” which is essentially a very flexible array-like
data type.
Define a table:
atable = {1, 2, 3, 4} -- A table with four elements, which are numbers.
Let's print it:
i = 1 -- Tables are indexed on one, NOT zero.
atable[index] True if there is an element at that index; nil is returned otherwise.
0 does NOT evaluate to false - only nil does.
while atable[i] do
print (atable[i]) -- Index into table using a number.
i = i + 1
end
Output of code above:
1
2
3
4
Tables can be indexed using element names instead of numeric indices. Since functions are first-
class variables, tables can be used to create "pseudo-classes." Classes are often used in object-
oriented programming.
Below is a table used to create a circle pseudo-class. It has 3 elements:
clr: a string containing the color of the circle
diam: a number containing the diameter of the circle
setdiam: a function, or method, used to change the diameter

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