William,

Yes, that's right. Nested arrays are not supported in Jmol. The only nested
arrays you can do are specifically 3x3 and 4x4 matrices, which have their
own special data types. But arrays of points are supported, so the simple
fix here is to use

$ x = [{111,222,0},{333,444,0}]
$ print x[1]
{111.0, 222.0, 0.0}
$ print x[2].x
333.0


Bob

On Sat, Dec 5, 2009 at 7:13 AM, William Lees <[email protected]> wrote:

> Is it possible to create nested arrays of integers in jmol script language?
> Here's what I've tried (in the current release version)
>
> $ x=[[111,222],[333,444]]
> $ y=x[1]
> $ print y
> 111
> 222
>
> $ print y[1]
> 1
>
> I can't really work out why y[1] is 1 and not 111 but I think it must have
> something to do with the default treatment of array elements as strings.
>
> Many thanks for any help.
>
> William Lees
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to