Hi all,

sometimes there is a problem with the ".." notation to access the value 
for a hash key in Jmol 14.3.13_2015.03.30 (and 14.3.13_2015.03.27).

It looks like it is related to local variables having the same name as 
the hash key:

----- Example 1 ----------
networkDefinitions = {"networkType": "test"}
function dotTest(dataHashref) {
   var nType       = dataHashref..networkType;
   var networkType = dataHashref..networkType;
   var n2Type      = dataHashref..networkType;
   print "nType=" + nType;
   print "networkType=" + networkType;
   print "n2Type=" + n2Type;
}
dotTest(networkDefinitions);

----- Example 1 Output -----
nType=test
networkType=
n2Type=
--------------------------

The same does work with global variables (or '.' notation):

----- Example 2 ----------
networkDefinitions = {"networkType": "test"}
function dotTest2(dataHashref) {
   nType       = dataHashref..networkType;
   networkType = dataHashref..networkType;
   n2Type      = dataHashref..networkType;
   print "nType=" + nType;
   print "networkType=" + networkType;
   print "n2Type=" + n2Type;
}
dotTest2(networkDefinitions);

----- Example 2 Output -----
nType=test
networkType=test
n2Type=test
--------------------------

Regards,
Rolf

-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  rhue...@fli-leibniz.de
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to