User manual
Section 2: TSP Programming Fundamentals Series 3700 System Switch/Multimeter Reference Manual
2-24 3700S-901-01 Rev. C / July 2008
The anonymous script may be saved to the flash drive without setting the
name attribute. For example, to save the anonymous script on the flash
drive as "MyAnonTest.tsp":
script.anonymous.save('/usb1/MyAnonTest.tsp')
Loading this file ('MyAnonTest.tsp') back into the unit from the flash drive will
cause an existing anonymous script to be overwritten.
Loading a user script
The following command is used to create a script from a specified file:
myscript = script.load(file, name)
Where:
myscript is the created script, or nil if an error occurred. If the name
parameter is an empty string, or if the name is absent or nil, and the script
name cannot be extracted from the file, this will be the only handle to the
created script.
file is the absolute or relative path and filename of the script file to import.
name (optional) is the name of the script to be created. The script's name
attribute is initialized to this value, which (if not an empty string) also serves
as the key used to access the script through the script.user.scripts
table.
If the name parameter is present (not nil), any script name embedded in the file
is ignored. Also, if name conflicts with the name of an existing script in the
script.users.scripts table, the existing script will be unnamed (that is, its
name attribute will be set to the empty string) before it is replaced in the
script.user.scripts table by the newly-created script.
If the name parameter is absent or nil, the command attempts to extract the
script's name from the file. Any conflict between the extracted name and that of
an existing script in the script.user.scripts table generates an error. If the
script name cannot be extracted, the created script's name attribute is initialized
to the empty string, and must be set to a valid non-empty string before saving
the script to internal memory.
The file to be uploaded must contain the loadscript or loadandrunscript
keywords, the script's body, and the endscript keyword.
Examples:
To load a file called "MyUserList.tsp" from the USB flash drive and name the
script "myuserlist," send the following command:
mylist = script.load('MyUserList.tsp', 'myuserlist')