On 10/15/2014 10:55 AM, Brenton Horne wrote:
> Hi, Rolf
>
> I've tried to implement this code as
>
>     function exportAnimation(jmol_movie, 500, 500, 180, "rotate
>     axisangle {1 1 0} 2")
>
>     {
>         var printFormat = "" + jmol_movie + "_%0" + stepCount.length +
>     "d.png";
>         var savedBackgroundColor = backgroundColor;
>         background [x101010];
>         for (var i=1; i<=stepCount; i++) {
>           var filename = format(printFormat, i);
>           var writeCommand = "write IMAGE " + 500 + " " + 500 + " PNGT 9
>     " + jmol_movie;
>           var dummy = script(writeCommand);
>           dummy     = script("rotate axisangle {1 1 0} 2");
>         }
>         background @savedBackgroundColor;
>     }
>
> And I got this error:
>
>     script compiler ERROR: ) expected
>     ----
>               function exportAnimation(jmol_movie, 500, 500, 180,
>     rotate  <<<<
>
You misunderstood my instructions. You should not change the code of the 
function itself!

The variables in the function definition must stay variables within the 
function. You cant't just change them to some arbitrary text or numbers. 
This will break the code.

The idea behind having a user-defined function is that you can call it 
with a large number of parameters without having to modify it.

In your case you would just call it like this after you have "installed" 
the original function code temporarily as I have described it:

exportAnimation("jmol_movie","500","500","180","rotate axisangle {1 1 0} 
2");

I hope this is more clear now.

Regards,
Rolf



-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  [email protected]
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to