Previous Up Next

5.4.9  Unassigning variables: VARS purge DelVar del restart rm_a_z rm_all_vars

Xcas has commands that help you keep track of what variables you are using and resetting them if desired. The VARS command will list all the variables that you are using, the purge, DelVar and del commands will delete selected variables, and the rm_a_z and rm_all_vars commands will remove classes of variables.


Example.
Input:

a:= 1
anothervar:= 2

then:

VARS()

Output:


a,anothervar


The purge command will clear the values and assumptions you make on variables (see Section 5.4.8). For TI compatibility there is also DelVar, and for Python compatibility there is del.


Example.
To clear the variable a:
Input:

purge(a)

or (for TI compatibility):
Input:

DelVar a

or (for Python compatibility):
Input:

del a


The rm_all_vars and restart commands clear the values and assumptions you have made on all variables you can use.



The rm_a_z command clears the values and assumptions on all variables with single lowercase letter names.


Example.
If you have variables names A,B,a,b,myvar, then after:
Input:

rm_a_z()

you will only have the variables named A,B,myvar.


Previous Up Next