MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Q) How to clear all variables

  • To: mathgroup at christensen.cybernetics.net
  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1727] Re: [mg1705] Q) How to clear all variables
  • From: John Fultz <jfultz>
  • Date: Fri, 21 Jul 1995 00:16:38 -0400

> My problem with mathematica is very simple but it hurts me a lot.
> 
> 
> 
> You know, if you want to clear from all the values you have assigned to 
> 
> 
> a variable named 'xy1', you simply digit:
> 
> Clear(xy1)
> 
> and you have it.
> 
> 
> But if you have been working for 1 hours and you want to clear all
> the variables you have assigned is there a way much simplier than:
> - digit: Clear(x1,x2,x3,.......,x10000)
> - save the notebooks, quit mathematica, restart mathematica, open the noteb.
> 
> ?????????????
> 
> 
> Please , someone asnwer me. I'm driving crazy.
> Thanks in advance.

Try the following:

ClearAll["Global`*"]

This will clear any symbols you create, but leave all packages you've loaded
intact.

To go a little further, in my personal init.m file, I define the
following two functions:

ClearGlobal[] := (ClearAll["Global`*"]; Clear[Derivative]; );

RemoveGlobal[] := (ClearGlobal[]; Remove["Global`*"];);

ClearGlobal[] clears all of the global variables, and also all
definitions for Derivative (e.g. f'[x] = x).  RemoveGlobal will first
clear the variables, then actually remove them from the symbol table.

John Fultz
Wolfram Research, Inc.


  • Prev by Date: Re: How to apply EdgeForm to ParametricPlot3D?
  • Next by Date: Re: How to apply EdgeForm to ParametricPlot3D?
  • Previous by thread: Q) How to clear all variables
  • Next by thread: Re: Q) How to clear all variables