Hi,

I am trying to move an echo diagonally across the Jmol applet using a  
function (I have created and positioned the echo at (0, 450) before  
calling the function). I want the echo to stop at (250, 200) or  
thereabouts.

function moveEcho
   for ( var i=0; i<250; i = i + 2 )
        x = script("set echo myecho " i + (450 - i) + "; delay 0.1;")   
        
   end for
end function


But I am getting a NaN for the second parameter, the y coord - here's  
what Jmol says back to me:

for ( var i=0; i<250; i = i + 2 )
x = script("set echo myecho " + i + " " + 450-i "; delay 0.1;") 
javascript: NaNset echo myecho 36 450
end for

(Note the "NaN" infront of "set" on the third line). So clearly Jmol  
does not want to subtract i from 450. Am I not allowed to use the  
variable twice in the same statement? Or am I missing something obvious?

Frieda


-----

Frieda Reichsman, PhD
Senior Research Scientist
The Concord Consortium
http://concord.org
25 Love Lane
Concord, MA 01742

Mon/Fri: 413-253-2405
Tu/Wed/Thu: 978-405-3228
mobile: 413-320-7449









-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to