I'm getting strange behavior in some of my notebooks that makes it seem like Import and Get load asynchronously. When I evaluate many cells together (for example, when I evaluate initialization cells), it seems as if Import, and sometimes Get, are "done" before the load is complete, so that subsequent cells are executed before loaded data (or executed commands) in the external file have have been fully loaded or executed.
For example, I have
data = Import["some data"];
and later in my notebook
something = doSomethingWith[data];
and I execute these cells together (e.g. as initialization cells), I get errors that indicate bad or non-existant values for data.
Similarly, when I have,
<<MySettings
and later
someSettingInMySettings = someModification;
I end up with the value for someSettingInMySettings that's defined in MySettings rather than someModification.
Do Import and Get load asynchronously? If so, is there a way to "wait" until they have completed before proceeding with evaluation?
Loadis not a standard function. Did you get it from a package?Getis not asynchronous. – Szabolcs Dec 16 '12 at 0:14Import; fixing now. – raxacoricofallapatorius Dec 16 '12 at 0:15Importin separate initialization cell before the later initialization cell that uses the stuff imported? or are they in the same cell? – Nasser Dec 16 '12 at 0:30