James,
That actually makes reasonable sense.
On Mon, Jun 25, 2012 at 2:18 PM, James Wonsever <[email protected]> wrote:
> I have been getting some confusing results while trying to use the Load
> "@data" method of loading. Jmol seems to be parsing | and newline
> characters differently.
>
> In the console application, this script command:
>
> mod = '5 \n MolName22Jun2012180152 \n C -0.00025 -0.00025 -0.00025 \n C
> 0.64018 0.64018 0.64018 \n C -0.64075 -0.64075 0.64049 \n C -0.64075
> 0.64049 -0.64075 \n C 0.64049 -0.64075 -0.64075';try{ LOAD '@mod';reset
> mod;}catch(e){}
>
>
Well, let's see. I think this depends upon exactly how you send that to
Jmol.
1) If this is within JavaScript, you will need \\n there:
var script = "mod = '5 \\n MolName22Jun2012180152 \\n C -0.00025 -0.00025
-0.00025 \\n C 0.64018 0.64018 0.64018 \\n C -0.64075 -0.64075 0.64049 \\n
C -0.64075 0.64049 -0.64075 \\n C 0.64049 -0.64075 -0.64075';try{ LOAD
'@mod';reset mod;}catch(e){}"
new way, using JmolApi.js:
Jmol.script(yourAppId, script)
or old way, using Jmol.js:
jmolScript(script, appExtension)
If you are sending it as an initial load script parameter, that can be a
real problem, and you MUST use '|' to separate lines.
With JmolApi.js, you can do this:
jmol = Jmol.getApplet("jmol")
Jmol.script(jmol, script)
just like that, no waiting. With Jmol.js you have to do an
appletReadyCallback to get that script to work with \n on all platforms.
> Will make 5 carbons in a tetrahedral shape, which it is supposed to (I
> think?). It does the same using the Jmol applet on ubuntu using IcedTea
> (firefox and chrome), but the applet fails on windows using sun Java 7.
> (firefox and chrome) Instead, on Windows, it loads 5 unknown (Xx) atoms,
> in a flat plane. I think as a JME format, not XYZ. I want the windows
> version to work the same as the Ubuntu, what do I need to do to make that
> work?
>
>
Possibly. You can tell for sure by looking at the Java console and seeing
what file type Jmol read. I have no idea why the different browsers are
behaving differently there.
> The script:
>
> mod = '5 | MolName22Jun2012180152 | C -0.00025 -0.00025 -0.00025 | C
> 0.64018 0.64018 0.64018 | C -0.64075 -0.64075 0.64049 | C -0.64075 0.64049
> -0.64075 | C 0.64049 -0.64075 -0.64075';try{ LOAD '@mod';reset
> mod;}catch(e){}
>
> Will load a methane molecule on all platforms, this doesn't match the
> input at all. I thought Jmol was supposed to treat pipes and newlines the
> same in this case. If you get rid of the spaces around the pipes, other
> weird things happened.
>
>
You sure you don't have the DATA keyword in there? With DATA Jmol replaces
the "inline character" (default "|") with \n. I'm surprised load '@mod'
does that.
Bob
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users