# Clearing maya variables and functions

**URL:** https://forum.highend3d.com/t/clearing-maya-variables-and-functions/5452
**Category:** Maya
**Tags:** mel
**Created:** [March 14, 2003, 1:49pm UTC](https://forum.highend3d.com/t/clearing-maya-variables-and-functions/5452 "2003-03-14T13:49:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![samgtn](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@samgtn](https://forum.highend3d.com/u/samgtn)
#### Post date: [March 14, 2003, 1:49pm UTC](https://forum.highend3d.com/t/clearing-maya-variables-and-functions/5452/1 "2003-03-14T13:49:56Z")

</div>

During debugging of MEL scripts, it's a constant nuisance to get errors about objects already being loaded, variables already assigned, etc.  
Is there a way to "initialize" the maya environment to the state it was in _before_ a script was run? I don't want the scene/objects to clear as with a File/NewScene command--just to clear out any changes that may have been made such as new functions being added, variables being assigned......?

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [March 14, 2003, 10:59pm UTC](https://forum.highend3d.com/t/clearing-maya-variables-and-functions/5452/2 "2003-03-14T22:59:03Z")

</div>

I don't think so.... once you define a variable, it sits in memorty until you quit and restart. Going forward however, if you're working from say, the Script editor, embed all your commands in curly braces, that way Maya will forget about them after the execution. Like:  
{  
float $asdf = 1.0;  
do something;  
}  
After execution, Maya won't know what $asdf is... That's your best bet I believe. I'd love to hear otherwise ![](http://64.32.63.100/forums/icons/smile.gif)
