On Apr 21, 2014, at 1:14 PM, Robert Hanson <[email protected]> wrote:
> 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.
Yeah, actually in reviewing some previous JMol list emails, I had seen an
answer from you that had used a script command that way and tried it. I didn’t
realize I had sent that version rather than the original,
for (var i = -45; i < -20;i = i + 1)
x = script("rotate x 4.28; translate x " + i/5 + "; delay 0.1”)
Which didn’t work either, of course.
>
> 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;'}
> }
> }
Neat! I wasn’t aware of this, I’ll have to look it up in the script doc and see
how that works.
>
> 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;'}
> }
> }
This worked after a tweak (added what was being written, deleted the semi-colon
after .png):
> function testWrite2 {
> for(var i=1; i < 11; i++) {
> rotate x 1;
> write file PNG @{'anim01/1_anim' + format("%02d",i) + '.png'}
> }
> }
>
>
Thanks again.
Frieda
------------------------------------------------------------------------------
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