So I guess I should not try to retrieve the label until the colorLabel
script has finished, so now I want to detect when the colorLabel script has
indeed finished...
I have the following:

when initializing the applet:
jmolSetCallback("MessageCallback","msgFn");

javascript function:
function msgFn() {
var x = [];
for (var i=0;i<arguments.length;i++) {
x[i] = "" + arguments[i];
}
var t = \'\n\' + document.getElementById(\'msg\').value;
document.getElementById(\'msg\').value = \'x[0] ---> \' + x[0] + \'\n\' +
\'x[1] ---> \' + x[1] + \'\n\' + \'x[2] ---> \' + x[2] + \'\n\' + \'x[3]
---> \' + x[3] + t;
}


This provides 2 "waves" of outputs, one when the script is called and
another when it is finished:
x[0] ---> jmolApplet0
x[1] ---> script 2 started
x[2] ---> colorLabel('NAT','CAV','manual','4:A','ONE')
x[3] ---> -4

x[0] ---> jmolApplet0
x[1] ---> Script completed
x[2] --->
x[3] ---> -1

So my aim is to relate the "Script completed" output with the command
"colorLabel('NAT','CAV','manual','4:A','ONE')"... It would be much easier if
instead of "Script completed" it was "script 2 completed", so I could
recognize the "2" in both "waves"... But the way it is I really don't know
how to relate the two "waves". Any of you have any idea?? This is killing
me...




2011/9/22 Daniel Carbajo <[email protected]>

> Mmmm, the above does not work for me... even in the console it only writes
> the "it worked" label, but no alert appears... As the residue is already
> labeled by my colorLabel function, I only need to retrieve such label, so
> trying to condense things in just one line of code, I have the following
> working in console:
> print {2:A.CA/1.1}.label <http://A.CA/1.1%7D.label>
> But again, in the javascript function, the following throws an error:
> var mylabel = jmolEvaluate('{2:A.CA/1.1}.label'<http://A.CA/1.1%7D.label'>
> );
>
> I should say also that the following does not work in console:
> mylabel = {2:A.CA/1.1}.label <http://A.CA/1.1%7D.label>
> print mylabel
> It outputs "expressionBegin"
>
>
>
> El 22 de septiembre de 2011 09:30, Angel Herráez 
> <[email protected]>escribió:
>
> Rolf is right; putting everything into a single script call is always
>> much better to prevent problems. Then, you don't need jmolScriptWait
>> most of the times.
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
>
------------------------------------------------------------------------------
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