Dear Bob,

I tried this one because it looks to me the more feasible. This gives me that 
error I told you.

Thanks Piero

function onClickLoadStruc() {
  jmolScriptWait("load ?; script scripts/name.spt;  background white")
  removeAllModels()
  loadModels()
}

--
Pieremanuele Canepa
Room 104
Functional Material Group
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom

e-mail: [email protected]
mobile: +44 (0) 7772-9756456
-----------------------------------------------------------

________________________________
From: Robert Hanson [[email protected]]
Sent: Thursday, April 15, 2010 1:44 PM
To: [email protected]
Subject: Re: [Jmol-users] (no subject)

what last one doesn't, and what comes up with what sort of error?

On Thu, Apr 15, 2010 at 7:02 AM, P.Canepa 
<[email protected]<mailto:[email protected]>> wrote:
The last one doesn't work. It comes up with an error JmolApplet0,,, Zapped! why 
?

Thanks

--
Pieremanuele Canepa
Room 104
Functional Material Group
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom

e-mail: [email protected]<mailto:[email protected]>
mobile: +44 (0) 7772-9756456
-----------------------------------------------------------

________________________________
From: Robert Hanson [[email protected]<mailto:[email protected]>]
Sent: Thursday, April 15, 2010 12:30 PM

To: [email protected]<mailto:[email protected]>
Subject: Re: [Jmol-users] (no subject)

       OnClick='jmolScript("load ?; script scripts/name.spt;  background 
white") + removeAllModels() + loadModels()'

adds function returns in JavaScript. I think you want semicolons. Generally 
good programming is to only have a single function in the onclick:

       OnClick='onClickLoadStruc()'


and then

function onClickLoadStruc() {
  jmolScript("load ?; script scripts/name.spt;  background white")
  removeAllModels()
  loadModels()
}

Remember that jmolScript() is asynchronous -- it queues the load command but 
continues immediately. You want:

function onClickLoadStruc() {
  jmolScriptWait("load ?; script scripts/name.spt;  background white")
  removeAllModels()
  loadModels()
}

Bob


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

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
[email protected]<mailto:[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
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to