Hi,

during my first steps into the fantastic new scripting possibilities
(thanks Bob!) I ran into a problem with "for" loops:

I wanted to program a countdown loop that displays a countdown in the
top left corner.

The first thing I noticed was that I had to provide the whole loop
commands in a single line. Distributing it over several lines as in the
example provided in the documentation resulted in the following error
message:

  script compiler ERROR: missing END for for

My script commands first initialize the echo and then run the countdown:

  set echo myecho 1% 99%; ~cd="Start"; echo %{~cd};
  for ( var i=5; i>0; i = i - 1); ~cd=i; delay 1; end for; ~cd="";

The loop never got beyond displaying "5" and I had to type "quit" in
order to be able to run additional commands.

If I used a "while" loop instead it worked as expected:

  i=5; while (i>0); ~cd=i; delay 1; i = i - 1; end while; ~cd="";


While testing this I noticed that the application (in contrast to the
applet) freezes immediately after typing the last letter of the command
"pause".

---- Test System ----------------
 Jmol: 11.3.25, application
 Java: 1.5.0_12
 OS  : Linux, OpenSuSE 10.2
---------------------------------

Regards,
Rolf

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to