To completely remove a script:
1. Remove the script from the run-time environment. Set any variables that refer to the script to
nil or assign the variables a different value. For example, to remove the script "beepTwoSec"
from the run-time environment, send the following code:
beepTwoSec = nil
2. Remove the script from the script.user.scripts table. Set the name attribute to an empty
string (""). This makes the script nameless, but does not make the script become the anonymous
script. For example, to remove the script named "beepTwoSec", send the following code:
script.user.scripts.beepTwoSec.name = ""
3. Remove the script from nonvolatile memory. To delete the script from nonvolatile memory,
send the command:
script.delete("name")
Where name is the name that the script was saved as. For example, to delete "beepTwoSec",
you would send:
script.delete("beepTwoSec")
Memory considerations for the run-time environment
The run-time environment has a fixed amount of memory for storing user scripts channel patterns,
DMM configurations, and other run-time information.
You can check the amount of memory in the instrument using the memory.used() and
memory.available() functions. These functions return the percentage of memory that is used or
available. When you send this command, memory used or available is returned as a comma-
delimited string with percentages for used memory.
The format is systemMemory, scriptMemory, patternMemory, configurationMemory,
where:
• systemMemory: The percentage of memory used or available in the instrument
• scriptMemory: The percentage of memory used or available in the instrument to store user
scripts
• patternMemory: The percentage of memory used or available in the instrument to store
channel patterns
• configurationMemory: The percentage of memory available to store DMM configurations.
For example, if you send the command:
MemUsed = memory.used()
print(MemUsed)
You will get back a value such as:
69.14, 0.16, 12.74, 15.35
Where:
• 69.14 is the percentage of memory used in the instrument
• 0.16 is the percentage used for script storage
• 12.74 is the percentage used for channel pattern storage
• 15.35 is the percentage used for DMM configuration storage
See memory.available() (on page 11-293) and memory.used() (on page 11-294) for more detail on
using these functions.