Keithley 2601B Reference Manual page 291

2600b series system sourcemeter instrument
Hide thumbs Also See for 2601B:
Table of Contents

Advertisement

Section 6: Instrument programming
Variable types
Variables can be one of the following types.
Variable types and values
Variable type returned
"nil"
"boolean"
"number"
"string"
"function"
"table"
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))
Example: Boolean
y = false
print(y, type(y))
Example: String and number
x = "123"
print(x, type(x))
x = x + 7
print(x, type(x))
6-14
Series 2600B System SourceMeter® Instrument Reference Manual
Value
not declared
true or false
number
sequence of words or
characters
a block of code
an array
nil
false
123
Adding a number to x forces its type to
number.
1.30
Notes
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 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.
All numbers are real numbers; there
is no distinction between integers
and floating-point numbers.
Functions perform a task or compute
and return values.
New tables are created with { }
braces. For example,
{1, 2, 3.00e0}.
nil
boolean
string
number
2600BS-901-01 Rev. B / May 2013

Advertisement

Table of Contents
loading

This manual is also suitable for:

2604b2614b2634b2635b2636b2602b ... Show all

Table of Contents