Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have seen questions on saving data on "global" context. Now if I set my notebook's evaluation context "unique to this notebook". the global context doesn't work quite well. Any idea what should i do to save every variable to a file in such a case?

Thanks!

OK, solved. What I should do is to replace "Global`" by whatever $Context returns

(Actually we should have a feature request so that Mathematica automatically saves everything in the notebook.)

share|improve this question
    
Something like: DumpSave["dumpfile.mx", Context[] // Evaluate]?? –  Sjoerd C. de Vries Apr 15 at 19:06
    
@kuba yes save to external file? –  bboczeng Apr 15 at 19:09
    
@SjoerdC.deVries I will try! –  bboczeng Apr 15 at 19:09
    
@SjoerdC.deVries: I tried using $Context to get the name of current context.. And it worked. Context[] will return too much contexts not relevant to this notebook –  bboczeng Apr 15 at 19:16
    
Context[] should return a single context. Are you sure you didn't type Contexts[]? –  Sjoerd C. de Vries Apr 15 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.