End
Details

- Every call to End must be balanced by an earlier call to Begin.
- End[] resets the values of $Context and $ContextAliases.
- End[] returns the present context name as a string of the form "context`".
- End[] does not modify $ContextPath.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Define a function f in the MyContext` Context:

https://wolfram.com/xid/0dskq-7e0nm


https://wolfram.com/xid/0dskq-j5jw7v


https://wolfram.com/xid/0dskq-j8alxw

https://wolfram.com/xid/0dskq-s71x2

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

https://wolfram.com/xid/0dskq-c5ci2p

Properties & Relations (3)Properties of the function, and connections to other functions
Begin["cont`"] sets $Context to "cont`":

https://wolfram.com/xid/0dskq-7m7isf


End restores $Context to its value before the matching Begin:

https://wolfram.com/xid/0dskq-foci5r

Unlike BeginPackage, Begin does not modify $ContextPath:

https://wolfram.com/xid/0dskq-f64hii

Similarly, End does not modify it, either:

https://wolfram.com/xid/0dskq-54u8m

Begin does not alter the value of $ContextAliases:

https://wolfram.com/xid/0dskq-097mdd

End restores $ContextAliases to its value before the matching Begin:

https://wolfram.com/xid/0dskq-8614wm

Wolfram Research (1988), End, Wolfram Language function, https://reference.wolfram.com/language/ref/End.html (updated 2021).
Text
Wolfram Research (1988), End, Wolfram Language function, https://reference.wolfram.com/language/ref/End.html (updated 2021).
Wolfram Research (1988), End, Wolfram Language function, https://reference.wolfram.com/language/ref/End.html (updated 2021).
CMS
Wolfram Language. 1988. "End." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/End.html.
Wolfram Language. 1988. "End." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/End.html.
APA
Wolfram Language. (1988). End. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/End.html
Wolfram Language. (1988). End. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/End.html
BibTeX
@misc{reference.wolfram_2025_end, author="Wolfram Research", title="{End}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/End.html}", note=[Accessed: 24-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_end, organization={Wolfram Research}, title={End}, year={2021}, url={https://reference.wolfram.com/language/ref/End.html}, note=[Accessed: 24-March-2025
]}