
Section 7: TSP command reference
Model 2657A High Power System SourceMeter® Instrument Reference Manual
7-370
2657A-901-01 Rev. B/December 2012
userstring.catalog()
This function creates an iterator for the user string catalog.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function No
Usage
for
name
in userstring.catalog() do
body
end
name
The name of the string; the key of the key-value pair
body
Code to execute in the body of the for loop
Details
The catalog provides access for userstring pairs, allowing you to manipulate all the key-value pairs in nonvolatile
memory. The entries are enumerated in no particular order.
Example 1
for name in userstring.catalog() do
userstring.delete(name)
end
Deletes all user strings in nonvolatile memory.
Example 2
for name in userstring.catalog() do
print(name .. " = " ..
userstring.get(name))
end
Prints all
userstring
key-value pairs.
Output:
product = Widgets
assetnumber = 236
contact = John Doe
The above output lists the user strings added in the
example for the
userstring.add()
function.
Notice the key-value pairs are not listed in the
order they were added.
Also see
(on page 7-369)
userstring.delete()
This function deletes a user-defined string from nonvolatile memory.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
Yes
Usage
userstring.delete(
name
)
name
The name (key) of the key-value pair of the userstring to delete
Summary of Contents for 2657A
Page 3: ......