Ah, good sleuthing, Angel. Yes, this is a mistake in the scripting that is
related to a bug in that version of 11.8.
x = 32
y = @x
now y = 32.
You can't just say @x in the middle of a math expression and expect Jmol to
ignore the @. I must admit, I can't find that in the documentation. But I
believe it was introduced a LONG time ago.
Bob
2012/3/9 Angel Herráez <[email protected]>
> Yes, you are right, Bob. There is no problem today ;-(
> But I swear it was not working yesterday. Just empty outputs when I
> queried for an array element. Goblins, probably.
>
> The issue behind is more complex, as you guessed. I was just trying
> to poke and see where the real problem was.
> After playing and trial, I found a cure. I'm not sure what is the
> rationale behind. Will try to describe it in a simplified example.
>
> This affects a script Eric did in Proteopedia for Molecular
> Playground (MPSupportVersion01.spt) so it's important to sort it out
> properly. Right now Ppedia uses Jmol 11.8 and the problem doesn't
> show up, but when I use it with 12.2 it just chokes.
>
> There is a first script file that is called, loads the model and also
> calls a 2nd script file (mentioned above).
>
> // script#1 //
> 1. calls script#2 using the "script" command
> 2. loads the pdb file
> 3. defines the array and passes it to a function which is defined in
> script#1
> var elist = array("C", "O", "N", "S")
> elementColorKey(elist)
>
> // script#2 //
> 1. defines a (global) variable
> colorCarbon = "[xA8A8A8]"
> 2. defines a function
> function elementColorKey(elist)
> which contains
> if (elist[i] == "C") { colorKey("Carbon", @colorCarbon) }
>
> That's where the error generates and the script stops. The error
> complains of an empty color specification ( color "" ) in the "color
> echo" line.
>
> When I removed the @ inside the function (just colorCarbon as 2nd
> parameter), the problem is gone in 12.2
>
> 3.
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> function colorKey(keyText, keyColor)
> {
> var vertDrop = colorKeyLineHeightPct * (colorKeyIndex - 1)
> var vertPct = colorKeyTopVertPct - vertDrop
> var echoName = "keyEcho" + colorKeyIndex
> set echo @echoName [0 @vertPct %] # upper left
> if (backgroundColor == "[x000000]") { background echo black }
> else { background echo white }
> background echo translucent 6
> color echo @keyColor
> font echo @echoColorKeyFontSize sansserif bold
> echo @keyText
> colorKeyIndex = 0 + 1 + colorKeyIndex
> #print (0 + colorKeyIndex)
> }
> # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users