Otis,
Here's a possible culprit. I see:
function processMessage(appNum, msg, indexNum) {
msg = "" + msg + "";
if (jmolDebugOn) { memVar1 += msg + "~"; }
if (getETV2 == true) { ETV2 = msg; getETV2 = false; }
if (getETV1 == true) { ETV1 = msg; getETV1 = false; }
if (getSmiles == true) { jmolSmiles = msg; getSmiles = false; }
if (msg.indexOf("echo @etv1") > -1) { getETV1 = true; }
if (msg.indexOf("echo @etv2") > -1) { getETV2 = true; }
if (msg.indexOf("print {*}.find('SMILES');") > -1) { getSmiles = true; }
if (msg.indexOf("assign atom") > -1) { picCenter = true; }
if (msg.indexOf("}) \"C\" {") > -1 || msg.indexOf("assign connect") > -1
|| msg.indexOf("new bonds") > -1 || msg.indexOf("assign bond") > -1) {
picMinimize = true; picCenter = false; }
if (msg.indexOf("Script completed") > -1 && picMinimize == true) {
picMinimize = false; doUFF(100); }
if (msg.indexOf("Script completed") > -1 && picCenter == true) {
picCenter = false; doUFF(2); }
}
Does this code work? I'm pretty sure "echo @etv2" will never be in the msg
variable - the script commands are sent in the third parameter -- what you
have called "indexNum"
I think I know what you are doing there -- processing messages to set global
variables. Rather than setting globals, you could put information in there
that identifies the message:
print "SMILES=" + {*}.find("SMILES")
then look for "SMILES=" in the message callback.
Similarly, I'm guessing your "echo @EVT2" could be replaced by a print
command:
print "EVT2=" + whatever
Then reserve ECHO for writing messages to the student on the screen.
Bob
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users