Message Boards Message Boards

0
|
5231 Views
|
4 Replies
|
4 Total Likes
View groups...
Share
Share this post:
GROUPS:

Avoid shared variables among notebooks because "globals"?

Posted 5 years ago

Hi there, I'm pretty new to Mathematica. Usually when I use Clear[X], variable X will lose its value and turn blue. But sometimes Clear[X] makes X lose its value but not turning blue and staying black. This is confusing, what is going on? And what is Kernel? I think things are related some way.

Edit: I was using K as variable and I discovered it's a special one. I also discovered that variables are shared among notebooks because "globals". How can I make local variables or how can I delete global ones?

Thanks.

POSTED BY: Ermanno Citraro
4 Replies

The uppercase letters C,D,E,I,K,N,O are used by the system, and will always be black. You had better avoid them as your own variable names. In general, it is advisable to start your variable names with a lowercase letter, which is guaranteed to avoid any conflict.

POSTED BY: Gianluca Gorni

Thanks. Do you know if there's the possibility to use "local" variables? I'd like to have variables seen only by the notebook they are defined in.

POSTED BY: Ermanno Citraro
Posted 5 years ago

I'd like to have variables seen only by the notebook they are defined in.

is-there-a-way-to-separate-variables-between-multiple-notebooks

POSTED BY: Robert H

Thank you.

POSTED BY: Ermanno Citraro
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract