Thank you, Nico, for releasing Jmol 12.0.RC27. It's finally time to call
this a version!
This last update adds some very powerful capability to Jmol that various
people have suggested over the years. It feels very much now like we have a
fully functional command language -- almost like bringing JavaScript right
into Jmol:
version=12.0.RC27
new feature: prompt(label,data,asButtons)
-----------------------------------------------------
Bring up a customizable pop-up box.
x = prompt("The file loaded properly.") # just shows an OK box
x = prompt("Enter a script command","") # returns user input or "null"
if (x != "null")script inline @x
x = prompt("Do you want to continue?","yes|no|cancel", true) # returns
"yes" "no" or "cancel"
x = prompt("testing",["yes","no","cancel"]) # returns 1, 2, or 3
see http://chemapps.stolaf.edu/jmol/docs/index.htm#prompt
new feature: associative arrays
---------------------------------------
b = {"test" : 34, "test2" : 45}
b["test"] = 35
b["test3"] =[2, 3, 4, 5]
print b["test"]
35
show b
b = { "test3":[2, 3, 4, 5],"test2":45,"test":35 }
b -= "test3"
show b
b = { "test2":45,"test":35 }
new feature: try/catch
----------------------------
And, with that, the opportunity to catch file load errors BEFORE they do the
ZAP...
load quartz.cif
refresh
while(true) {
try{
load "adfkjd" # will be caught
} catch(e) {
prompt @e
break # from WHILE
}
prompt "The file was loaded successfully.
break;
}
# quartz still loaded.
see http://chemapps.stolaf.edu/jmol/docs/index.htm#try
new feature: SWITCH/CASE
-----------------------------------
-- more like JavaScript than Java
-- like JavaScript, doesn't need constants
-- like JavaScript, evaluations can be made in the cases
-- really just a simpler form of IF/ELSEIF/ELSE
-- expressions are evaluated only as necessary from the top down
-- DEFAULT may appear along with any of the CASE statements
switch(prompt("What would you like to see?",
["Spacefill","Wireframe","Ball&Stick"])) {
case 1:
spacefill only
break;
case 2:
wireframe only
break;
case 3:
wireframe only;wireframe reset;spacefill reset
break;
}
see http://chemapps.stolaf.edu/jmol/docs/index.htm#switch
new feature: fux, fuy, fuz, fuxyz, and set fractionalRelative
------------------------------------------------------------------------
fux, fuy, fuz are the fractional coordinates based on the current unit
cell.
set frationalRelative makes {1/1 1/2 1/1} and cell=555 and cell ={1 1 1}
all relative to
the current unit cell.
--
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
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users