Model 2450 Interactive SourceMeter® Instrument Reference Manual
Section 8: TSP command reference
2450-901-01 Rev. B/September 2013
8-85
Example 1
test8.save()
Saves the script referenced by the variable
test8
to nonvolatile memory.
Example 2
test8.save("/usb1/myScript.tsp")
Saves the script referenced by the variable
test8
to a file named
myScript.tsp
on your
flash drive.
Also see
(on page 7-5)
scriptVar.source
This attribute contains the source code of a script.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Attribute (R)
No
Not applicable
Not saved
Not applicable
Usage
code
=
scriptVar
.source
scriptVar
The name of the variable that references the script that contains the source code
code
The body of the script
Details
The body of the script is a single string with lines separated by the new line character.
Example
print(test7.source)
Assuming a script named
test7
was created on the instrument, this example retrieves the source code.
Output:
reset()
display.settext(display.TEXT1, "Text on User Display 1")
display.settext(display.TEXT2, "Text on line 2")
Also see
(on page 8-84)