2
$\begingroup$

This question already has an answer here:

Take this code :

    nomFichier = 
  "C:\\Users\\Me\\Dropbox\\testFile.wdx";

<<  nomFichier;
<<  "C:\\Users\\Me\\Dropbox\\testFile.wdx";

The first line works whereas the second one doesn't : why ?

The error is :

Get::noopen: Cannot open nomFichier.
$\endgroup$

marked as duplicate by Itai Seggev, Michael E2, m_goldberg, MarcoB, Kuba Jul 18 '17 at 6:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4
$\begingroup$

According to the documentation:

<<"name" is equivalent to <<name. The double quotes can be omitted if 
the name is of the form specified in "Operator Input Forms".

So, << treats the literal expression as a file name.

Get[expression]

works, but the << form even ignores Evaluate.

$\endgroup$
  • $\begingroup$ In fact I read it also but how to tell to mathematica use the value of the variable and not its name. Is it possible ? $\endgroup$ – StarBucK Jul 17 '17 at 23:02
  • 1
    $\begingroup$ @StarBucK See edit. $\endgroup$ – John Doty Jul 17 '17 at 23:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.