PDA

View Full Version : Clearing a variable definition


alesmav
09-10-2003, 11:52 AM
Does anybody now how do I clar the variable definition?
For example, if I first define let's say $ups as a string:

string $ups;

I execute the script...

Then for some reason I want to redefine $ups as a float:

float $ups;

But then I get this message:
"Error: Invalid redeclaration of variable "$ups" as a different type."

I understand that the string $ups gets buffered, but I would like to know how to delete $ups variable definition from this buffer without having to restart Maya.

Thnx

ALES

galactor
09-10-2003, 11:59 AM
Close Maya -> Start Maya up again.
As far i know there is no sollution for this problem :(

:: Galactor ::

mhovland
09-10-2003, 02:20 PM
You need to make sure your declarations are inside curly braces { }. This keeps them local to the procedure or script, and they are destroyed upon completion of the script.

If you are typing commands in the script editor, make sure you add { } around all the commands.

If you are writing everything in an external script file, either open and close the code with {}, or wrap all the commands inside a procedure.

mark_wilkins
09-11-2003, 01:40 AM
Yeah, that works except for global variables. :D

-- Mark

mhovland
09-11-2003, 11:59 AM
Oops!:blush:

alesmav
09-11-2003, 01:16 PM
Thanks a lot... so curly brackets are my friends... :)

ALES

CGTalk Moderation
01-16-2006, 02:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.