Re: ClearAll ?? or what
- To: mathgroup at smc.vnet.net
- Subject: [mg102806] Re: ClearAll ?? or what
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Thu, 27 Aug 2009 06:38:22 -0400 (EDT)
- References: <h7371j$b28$1@smc.vnet.net>
Hi, > Is there a command that will remove all variables, custom functions, > equations and so on? > I have tried every one that I can find including ClearAll [ " Global ' * " > ], and so on. and what is wrong with ClearAll["Global`*"] ? It should basically do what you want. Have you problems with it? Note that you need a backquote (` not ') and no spaces in the argument, maybe you want to copy and paste from this post to get it right. There are some pitfalls though: 1) If you define symbols in other contexts, you will miss them with just "Global`*", but if you never use BeginPackage, Begin or $Context, that should not be the case. 2) ClearAll only removes all definitions for a symbol, not the symbols themselves. You could use Remove["Global`*"] to completely remove the symbols, and not only their definitions. In most cases the outcome is the same, but of course there are cases where not. hth, albert