Sounds good. Glad I could help. :)

Chris



Ian Thomas wrote:
> Hi Chris,
>
> Thanks for your suggestions.
>
> I'm not too sure about your suggestion 1 - perhaps a Jmol expert will
> know how to check if Jmol has finished loading the molecule?
>
> However, your suggestion 2 has got me somewhere. I modified my
> javascript so that if 'jmolGetPropertyAsArray("atomInfo", "all")'
> returns null or an empty list, my code uses 'setTimeout()' to call
> itself again in 50 millisecs to try again. I added a function-scope
> static counter variable to remember how many attempts it has made -
> after 10 attempts it gives up and displays an alert to the user (to
> prevent an infinite loop). This seems to work quite well. On average it
> seems to need 2 to 3 attempts at this interval before Jmol is ready to
> give the 'atomInfo' property back. I've never seen it fail after 10
> attempts (half a second) and give up.
>
> I'm not sure how stable/reliable this mechanism will be on different
> browsers/systems, but it does seem to work for me. Thanks! :-)
>
> I'd still be really interested to know if there's a simpler easier way
> to achieve this using standard Jmol scripting though. There must be an
> easier way?!
>
> Thanks very much,
>
> Ian
>
>
> LEGAL NOTICE
> Unless expressly stated otherwise, information contained in this
> message is confidential. If this message is not intended for you,
> please inform [email protected] and delete the message.
> The Cambridge Crystallographic Data Centre is a company Limited
> by Guarantee and a Registered Charity.
> Registered in England No. 2155347 Registered Charity No. 800579
> Registered office 12 Union Road, Cambridge CB2 1EZ.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>   

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to