Just so you know, you don't have to use the arguments variable, you can just
do this:

fucntion msgFn(app, status, msg) {
   ...do something with msg.
}

The return would do nothing. Jmol will just ignore it.

However, you can use this

<JmolScript>

print javascript("prompt('testing')")

That is, within in Jmol, get the response from a JavaScript prompt and print
it. So you could do something like this within Jmol

Var x = javascript("msgFn('testing',1,2,3)")

and thus deliver that value "2" (based on your function) to the Jmol
variable x.

Bob





On Tue, Sep 27, 2011 at 5:00 AM, Daniel Carbajo <[email protected]>wrote:

> Just one little more question about this...
> Can I return a javascript in the msgFn function that I call
> like: jmolSetCallback("MessageCallback","msgFn");
> and use that variable in another normal javascript function?
>
> Something like:
> in javascript:
> function msgFn() {
> var x = [];
> for (var i=0;i<arguments.length;i++) {
>  x[i] = "" + arguments[i];
> }
> return x[2];
> }
>
>
> --
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
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to