Section 6: Instrument programming
Models 707B and 708B Switching Matrix Reference Manual
6-40
707B-901-01 Rev. B / January 2015
Retrieve a script as a single string
To retrieve the entire user script source code as a single string, use the
scriptVar.
source
attribute. The
loadscript
or
loadandrunscript
and
endscript
keywords are not included.
To retrieve the source code as a single string, send the command:
print(
scriptVar
.source)
Where
scriptVar
is the name of the script.
Example: Retrieve the source code as a single string
print(test.source)
Retrieve the source of a script named
"
test
".
Output might look similar to:
display.clear()
display.settext("This is a
test") print("This is a
test")
Retrieve a script using TSB Embedded
In TSB Embedded, from the User Scripts list, select the script you want to retrieve. The contents of
the script are displayed.
Script example: Retrieve the content of scripts
This set of examples:
•
Retrieves the source of a script using
scriptVar
.list()
•
Retrieves the source of a script using
scriptVar
.source