EasyManuals Logo

Tektronix KEITHLEY 2600B Series User Manual

Tektronix KEITHLEY 2600B Series
834 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 #237 background imageLoading...
Page #237 background image
Section 8: Instrument programming Series 2600B System SourceMeter® instrument Reference Manual
8-16 2600BS-901-01 Rev. F/August 2021
Variable types
Variables can be one of the following types.
Variable types and values
Variable type returned
Value
Notes
"nil"
not declared
The type of the value nil, whose main property is
to be different from any other value; usually it
represents the absence of a useful value.
"boolean"
true or false
Boolean is the type of the values false and true.
In Lua, both nil and false make a condition
false; any other value makes it true.
"number"
number
All numbers are real numbers; there is no
distinction between integers and floating-point
numbers.
"string"
sequence of words or
characters
"function"
a block of code
Functions perform a task or compute and return
values.
"table"
an array
New tables are created with { } braces.
For example:
{1, 2, 3.00e0}
"userdata"
variables
Allows arbitrary program data to be stored in Lua
variables.
"thread"
line of execution
To determine the type of a variable, you can call the type() function, as shown in the
examples below.
The output you get from these examples may vary depending on the data format that is set.
Example: Nil
x = nil
print(x, type(x))
nil nil
Example: Boolean
y = false
print(y, type(y))
false boolean
Example: String and number
x = "123"
print(x, type(x))
x = x + 7
print(x, type(x))
123 string
Adding a number to x forces its type to number.
130 number

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tektronix KEITHLEY 2600B Series and is the answer not in the manual?

Tektronix KEITHLEY 2600B Series Specifications

General IconGeneral
BrandTektronix
ModelKEITHLEY 2600B Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals