Just a warning -- I spent much of the weekend rewriting sections of the Jmol
code for better handling of Jmol script arrays. I think I was pretty
careful, but it was quite involved, and you might get a null pointer
exception or especially a class-cast exception in 12.1.31_dev. I THINK it's
all good -- passed the MonsterScript test -- but there could be something
in there I missed. Basically,
x = [3,4,5, [5,6, 7], "test", {2,3,5}]
is saved as before (though way more efficiently), and there is a new
assignment operator:
y == x[2]
that "==" there assigns "by reference" one array variable to another, sort
of like setting a pointer in C++. This means that now "y" and "x[2]" both
point to the same thing, and you can do things like:
y[1] = 33
thus changing (x[2])[1] as well.
I couldn't think of anything better than == there --- sort of a "make
equivalent to" idea.
Also, I added a .sort(n) function that allows you to sort an array based on
a given element number. So, for example, I needed to sort a bunch of points
based on distance along a line:
Var a = []
a[1] = [3.5, {3 4 5}]
a[2] = [-1.0, {5 6 7}]
a[3] = [2.0, {1 0 1}]
then
Var b = a.sort(1)
creates:
b = [ [-1.0, {5 6 7}], [2.0, {1 0 1}], [3.5, {3 4 5}] ]
and
Var c = a.sort(2)
sorts on the points themselves (distance from origin) instead.
This way you can basically set up any sort you want of anything.
Anyway, let me know if you run into any problems.
Bob
ps -- Piero, this is for the Brillouin business, which is looking very good.
--
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
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers