On 09/16/2015 07:00 AM, Robert Hanson wrote:
> new feature: JmolSQL {associative array}.select("xxx** where...")
> -- double * indicates desire to return full sub-arrays, with keys
> -- "all keys starting with "xxx";
> -- uses LIKE
> -- can be at beginning or end or both: xxx**, **xxx, **xxx**
> -- WHERE clause is optional
>
Maybe I have misunderstood something but none of the three variants
worked for me, only '**' alone:
---- Example Code ----------------
function selectTest(filter) {
var testHash = [1: [resName: "VAL", resNumber: 1,
siteMembers: [[resName: "VAL", resNumber: 10],
[resName: "TYR", resNumber: 14],
[resName: "GLY", resNumber: 17]
]
],
2: [resName: "TYR", resNumber: 14,
siteMembers: [[resName: "VAL", resNumber: 1],
[resName: "VAL", resNumber: 10],
[resName: "GLY", resNumber: 17]
]
]
];
return testHash.select(filter);
}
print "==== Result 1 (res**) =========";
print selectTest("res** WHERE resName='VAL'");
print "==== Result 2 (**res) =========";
print selectTest("**res WHERE resName='VAL'");
print "==== Result 3 (**res**) =========";
print selectTest("**res** WHERE resName='VAL'");
print "==== Result 4 (**) =========";
print selectTest("** WHERE resName='VAL'");
---- Example Output --------------
==== Result 1 (res**) =========
==== Result 2 (**res) =========
==== Result 3 (**res**) =========
==== Result 4 (**) =========
{
"1" :
{
"resName" : "VAL"
"resNumber" : 1
"siteMembers" :
[
{
"resName" : "VAL"
"resNumber" : 10
}
{
"resName" : "TYR"
"resNumber" : 14
}
{
"resName" : "GLY"
"resNumber" : 17
}
]
}
}
----------------------------------
Regards,
Rolf
--
Rolf Huehne
Postdoc
Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany
Phone: +49 3641 65 6205
Fax: +49 3641 65 6210
E-Mail: [email protected]
Website: http://www.fli-leibniz.de
Scientific Director: Prof. Dr. K. Lenhard Rudolph
Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein
VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users