I don't see that exact compiler error when I run this in 14.0.13. What I
see is an execution error:

script ERROR: bad argument count
----line 1 command 1 of function testwrite:
         script "rotate x 1;  write file PNG anim01/1_anim" + i + ".png;" <<
----line 2 command 2 of function testwrite:
          x = script ( "script 'rotate x 1;  write file PNG anim01/1_anim'
+  i + '.png;'" )
----line 1 command 1 of function testwrite:
         for ( var i = 1 ; i < 11 ; i = i + 1 )
----

So I also don't see how it would run in general. There is no script command
like that.

Here's a simpler version:

function testWrite2 {
  for(var i=1; i < 11; i++)  {
    script inline @{'rotate x 1;  write anim01/1_anim' +  i + '.png;'}
  }
}

also, you can left-zero-pad those file names:

function testWrite2 {
  for(var i=1; i < 11; i++)  {
    script inline @{'rotate x 1;  write anim01/1_anim' +  format("%02d",i)
+ '.png;'}
  }
}

and there really is no need for the script command. So that can be as
simple as:

function testWrite2 {
  for(var i=1; i < 11; i++)  {
     rotate x 1;
     write @{'anim01/1_anim' +  format("%02d",i) + '.png;'}
  }
}





On Mon, Apr 21, 2014 at 10:44 AM, Frieda Reichsman <[email protected]>wrote:

> I am also having trouble with a simple, previously successful for loop in
> the Java app:
>
> function testWrite
>   for(var i=1; i < 11; i++)
> x = script("script 'rotate x 1;  write file PNG anim01/1_anim' +  i +
> '.png;'")
>   end for
> end function
>
> The Java app tells me:
>
> script compiler ERROR: command expected
> ----
>           >>>>   for(var i=1 <<<<
> $
>
> Sorry to ask more than one thing at a time, but since they both involve
> for loops I thought they might be related.
>
>
> On Apr 21, 2014, at 10:46 AM, Frieda Reichsman <[email protected]> wrote:
>
> Oh yeah— I’m using Jmol 14.0.13.
>
> On Apr 21, 2014, at 10:42 AM, Frieda Reichsman <[email protected]> wrote:
>
> Hi Bob,
>
> The following works for “growing” spacefill when I use the signed applet,
> but not when I use JSMol:
>
> function off2cpk
> delay 0.1
>   set hermiteLevel 0
>
>   for ( var i=0; i<91; i = i + 5 )
> x = script("cpk " + i + "%; delay 1; refresh;")
>   end for
>
>   set hermitelevel 4
> delay 0.1
> end function
>
>
>
> Do I need to be doing something differently here?
>
> Frieda
>
>
> ///////////////////////////////////////////
>
> Frieda Reichsman
> Molecules in Motion
> Interactive Molecular Structures
> http://www.moleculesinmotion.com
>
> ///////////////////////////////////////////
>
>
>
>
>
> ------------------------------------------------------------------------------
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
>
> http://p.sf.net/sfu/ExoPlatform_______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
>
> ------------------------------------------------------------------------------
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to