From: Bob F on
Can anyone tell me why this works as expected:

dirnames = Names["$*Directory*"];
For[i = 0, i < Length[dirnames], i++; Print[dirnames[[i]]]]

and gives the following results:

$AddOnsDirectory

$BaseDirectory

$HomeDirectory

$InitialDirectory

$InstallationDirectory

$LaunchDirectory

$PreferencesDirectory

$RootDirectory

$TemporaryDirectory

$TopDirectory

$UserAddOnsDirectory

$UserBaseDirectory

$UserBasePacletsDirectory

$UserDocumentsDirectory

But that the following doesn't give any results:

dirnames = Names["$*Directory*"];
For[i = 0, i < Length[dirnames], i++; Symbol[dirnames[[i]]]]

but if I go thru the dirnames array elements manually it works as I
would expect, e.g.

In[161]:= Symbol[dirnames[[1]]]

Out[161]= "/Library/Mathematica"

Why does the Print[dirnames[[i]]] work OK but the
Symbol[dirnames[[i]]] fail to give anything?

Thanks...

-Bob

 | 
Pages: 1
Prev: Equation style crash bug
Next: Syntax coloring