EasyManuals Logo
Home>Keithley>Measuring Instruments>SourceMeter 2611

Keithley SourceMeter 2611 Reference Manual

Keithley SourceMeter 2611
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 #114 background imageLoading...
Page #114 background image
2-62 TSP Programming Fundamentals Series 2600 System SourceMeters Reference Manual
2600S-901-01 Rev. A / May 2006 Return to Section 2 topics
String library functions
This library provides generic functions for string manipulation, such as finding and
extracting substrings. When indexing a string in TSL, the first character is at
position 1 (not 0 as in ANSI C). Indices may be negative and are interpreted as
indexing backwards, from the end of the string. Thus, the last character is at
position 1, and so on.
tonumber(x [,base])
Returns x converted to a number. If x is already a number, or
a convertible string, then the number is returned; otherwise, it
returns nil.
An optional argument specifies the base to interpret the
numeral. The base may be any integer between 2 and 36,
inclusive. In bases above 10, the letter ‘A’ (in either upper or
lower case) represents 10, ‘B’ represents 11, and so forth,
with ‘Z’ representing 35. In base 10, the default, the number
may have a decimal part, as well as an optional exponent. In
other bases, only unsigned integers are accepted.
tostring(x)
Receives an argument of any type and converts it to a string
in a reasonable format.
type(v)
Returns the type of its only argument, coded as a string. The
possible results of this function are: nil, numbe, boolean,
table, or function.
NOTE: TSL does automatic memory management. That means that you do not have to worry about
allocating memory for new objects and freeing it when the objects are no longer needed. TSL manages
memory automatically by running a garbage collector from time to time to collect all dead objects (that is,
those objects that are no longer accessible from TSL). All objects in TSL are subject to automatic
management: tables, variables, functions, threads, and strings. TSL uses two numbers to control its
garbage-collection cycles. One number counts how many bytes of dynamic memory TSL is using; the
other is a threshold. When the number of bytes crosses the threshold, TSL runs the garbage collector,
which reclaims the memory of all dead objects. The byte counter is adjusted, and then the threshold is
reset to twice the new value of the byte counter.
string.byte(s [,i])
Returns the internal numerical code of the i-th character of
string s, or nil if the index is out of range.
string.char(i1, i1, …)
Receives 0 or more integers. Returns a string with length
equal to the number of arguments, in which each character
has the internal numerical code equal to its corresponding
argument.
string.format(fs, e1,
e2, …)
Returns a formatted version of its variable number of
arguments following the description given in its first
argument, which must be a string. The format string follows
the same rules as the print family of ANSI C functions. The
only differences are that the options/modifiers *, l, L, n, p,
and h are not supported. The options c, d, E, e, f, g, G, I, o, u,
X, and x all expect a numeric argument, where s expects a
string argument. String values to be formatted with %s
cannot contain embedded zeros.
string.len(s)
Returns the length of the strings.

Table of Contents

Other manuals for Keithley SourceMeter 2611

Questions and Answers:

Question and Answer IconNeed help?

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

Keithley SourceMeter 2611 Specifications

General IconGeneral
BrandKeithley
ModelSourceMeter 2611
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals