rob yang wrote:
> Hi list,
> I am trying to use the getPropertyAsArray function with my applet as
> the following:
>
> var bleh = applet.getPropertyAsArray("boundboxInfo");
> alert(bleh.length);
> alert(bleh.center[0]);
>
The call is
jmolGetPropertyAsArray()
not
applet.getPropertyAsArray()
The result is an associative array object. It has
boundboxInfo=new Array()
boundboxInfo.center=new Array()
boundboxInfo.center[0]=0
boundboxInfo.center[1]=0
boundboxInfo.center[2]=0
boundboxInfo.edge=new Array()
boundboxInfo.edge[0]=1.9605223
boundboxInfo.edge[1]=1.9605223
boundboxInfo.edge[2]=0
Your second alert should then work.
Bob Hanson
> But the above code does not work because no alerts are raised.
> However, if it works if I try:
>
> var bleh = applet.getPropertyAsString("boundboxInfo");
> alert(bleh);
>
> Also works for:
> var bleh = applet.getPropertyAsJSON("boundboxInfo");
> alert(bleh);
>
> Now I am convinced that this is an user error, so what am I doing
> wrong? I could write a parsing function I suppose but pretty sure I
> don't need to re-invent the wheel here, just need to learn how to use
> the wheel properly. Thanks again.
>
> - Rob
>
>
> ------------------------------------------------------------------------
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Robert M. Hanson
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
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users