Section 9: TSP command reference Series 2600B System SourceMeter® instrument Reference Manual
9-412 2600BS-901-01 Rev. F/August 2021
userstring.catalog()
This function creates an iterator for the user-defined string catalog.
Usage
for name in userstring.catalog() do body end
The name of the string; the key of the key-value pair
Code to execute in the body of the for loop
Details
The catalog provides access for user-defined string 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-defined strings in nonvolatile memory.
userstring.add("assetnumber", "236")
userstring.add("product", "Widgets")
userstring.add("contact", "John Doe")
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
Notice the key-value pairs are not listed in the order they were added.
Also see
userstring.add() (on page 9-411)
userstring.delete() (on page 9-413)
userstring.get() (on page 9-414)