3

Is there a way to DumpSave all the variables in the notebook? Or better whole notebook so that opening it would restore all the definitions.

xyz
  • 605
  • 4
  • 38
  • 117
Al Guy
  • 1,610
  • 1
  • 10
  • 15

1 Answers1

1

Definition of a variable in a context is done by myContext`a=100; !! Typing "a" later will not give 100!! To call the content defined above you need to specifiy the context other wise it is assumed Global`. So use myContext`a to get 100.

Do this with all the needed variables in the notebook. You can use DumpSave["file","myContext`"] to save all the definitions at once.

theDriver
  • 634
  • 5
  • 13
Eisbär
  • 1,476
  • 7
  • 14
  • Does that mean that in principle all the global variables can be saved by DumpSave["file","Global"]`? – Al Guy Sep 02 '15 at 02:06
  • I was not sure if Globalcontext is far more than your defined variables. I just tried ?Global* and indeed I only get my defined variables/functions and not some genereal Mathematica definitions. – Eisbär Sep 02 '15 at 08:05