Save As dialogue & clearing vars?

Ok, so I found something like "fileDialog" will open the "Open" dialogue, and allow the user to search for which file to open, but how do I display the "Save As" dialogue allowing the user to specify what file and directory they would like to save to, and return that filepath?

Also, is there a way to erase all the vars I've created in my recent Maya session? I keep having to either shut down and restart Maya, or just make sure and {bracket} my commands and make sure I print it out before exiting the bracket and such... Any command to dump all the variables I've created?

Thanks...

fileBrowserDialog command offes more customization. It's available on win platform only.

You can't undeclare a variable. Only way variable name can be "lost" is to go out of scope. So use brackets.

You can dump all global variables using env command:

string $vars[] = env;
print $vars;