Message Boards Message Boards

Erase saved Values ?

GROUPS:

Hi, in a Notebook, I defined some constants by numerical values. But I cannot erase that definition. Neither by opening a new Notebook, nor by using the command "Clear". Does someone know how to do that?

POSTED BY: Jonas Hamp
Answer
6 months ago

What did you do exactly with Clear? This way works for me:

a = 1;
Clear[a]

Another way:

a = 1;
a =.

A more drastic Clear, that wipes out all symbols in the Global context:

Clear["Global`*"]
POSTED BY: Gianluca Gorni
Answer
6 months ago

Perhaps you are troubled that the symbol a remains even after you use Clear on it:

    Names["Global`*"]
{}
    a = 1;
    Clear[a]
    Names["Global`*"]
{a}

In that case, you could use Remove instead of Clear:

    Remove[a]
    Names["Global`*"]
{}
POSTED BY: Murray Eisenberg
Answer
6 months ago

Thank you very much, the "Remove" Command works very well. Have a nice day.

POSTED BY: Jonas Hamp
Answer
6 months ago

Group Abstract Group Abstract