End

End[]
returns the present context, and reverts to the previous one.

DetailsDetails

  • Every call to End must be balanced by an earlier call to Begin.
  • End[] resets the value of $Context.
  • End[] returns the present context name as a string of the form .
  • End[] does not modify $ContextPath.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Define a function in the Context:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input

Restore the context:

In[4]:=
Click for copyable input
Out[4]=

The context is now what it was before Begin was used:

In[5]:=
Click for copyable input
Out[5]=
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »