Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Clearing functions and variables

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1994] Re: Clearing functions and variables
  • From: Scott.A.Hill at williams.edu (Lancelot)
  • Date: Wed, 6 Sep 1995 23:50:20 -0400
  • Organization: Williams College, Williamstown MA

In article <DEEtnC.DHL at wri.com>,
Michael A. Rutter <rutter at euler.mcs.utulsa.edu> wrote:
>
>Does anybody know a simple command to clear all the variables and functions in
>a Mathematica session.  We have been using Clear /@ Names["Global`*"], but
>since we are teaching a freshman level Calc course, this is difficult to
>explain.

	There is a package called "CleanSlate" which will utterly
restore Mathematica to its condition at start-up.  But if you don't
feel like hunting that down, Clear["Global`*"] should do the trick
rather easily.  Or define a function such as this at the start of each
session:

AllClear[]:= (
	confirm =
	StringTake[InputString["Confirm clear by typing 'y'"],1]=="y";
	If[confirm, (ClearAll["Global`*"];Remove["Global`*"]),Null]);
Protect[AllClear];

You can omit the prompt if you want, of course, like so:

AllClear[]:=(ClearAll["Global`*"]; Remove["Global`*"]);
Protect[AllClear];

/
:@-) Scott
\

Unsophisticated, but I get by.



  • Prev by Date: natural log of E
  • Next by Date: Re: Advice on "MMA for Scientists and Engineers" Book
  • Previous by thread: Re: Clearing functions and variables
  • Next by thread: simplify