Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-08 Thread Kubasik, Matthew A.
How about here? http://wiki.jmol.org/index.php/Scripting/GetProperty On Jul 8, 2016, at 11:46 AM, Angel Herráez > wrote: Sure! The question is... where to locate it? Goes to the to-do list. Suggestions or actual page edition are welcome

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-08 Thread Angel Herráez
Sure! The question is... where to locate it? Goes to the to-do list. Suggestions or actual page edition are welcome On 8 Jul 2016 at 9:59, Robert Hanson wrote: Might be a nice addition to the Wiki. -- Attend Shape:

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-08 Thread Robert Hanson
Might be a nice addition to the Wiki. On Fri, Jul 8, 2016 at 9:16 AM, Latévi Max LAWSON DAKU wrote: > Dear Bob, > > Thanks a lot for your answer. > > Your solution is also the one given by Matt and it works :) > > > I'm attaching a README file, which I wrote to keep track

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-08 Thread Latévi Max LAWSON DAKU
Dear Bob, Thanks a lot for your answer. Your solution is also the one given by Matt and it works :) I'm attaching a README file, which I wrote to keep track of what I did. It's far from being perfect. But I hope it may be helpful to someone. Thanks again, Bob, Matt and Angel! Best, Max

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Robert Hanson
My message came out somewhat garbled, I think. Trying again: i = 7 print getproperty('modelInfo.models['+i+'].modelProperties.FreqValue') -- Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San Francisco,

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Robert Hanson
On Thu, Jul 7, 2016 at 9:38 AM, Latévi Max LAWSON DAKU wrote: > Dear Jmol users/developers, > > I would like to be able to use a variable in a call to getProperty. > So far, the following command works. > > $ print

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Kubasik, Matthew A.
Thanks, Angel. I'm never sure about these things. Sometimes in my scripts I get "TRUE" when I'm expecting a numerical result. This makes me think I'm mixing types. Maybe I'm just mis-using built in functions. But that's for another thread! From: Herráez

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Herráez Sánchez Ángel
Yes, Matt it will be corrrect and safe. Jmol scripting does not care about variable types, as far as I know You are right this is a string issue and concatenation is the right approach.

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Kubasik, Matthew A.
Hi, Max, Yes, I think the stuff inside the parentheses is literally a string, so,if you want to vary the string, you need to reconstruct the string in your loop with the + signs. Although it "works", I think the line sums two different types (string and integer), so, I am not certain the

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Latévi Max LAWSON DAKU
On 07. 07. 16 17:04, Kubasik, Matthew A. wrote: > Max, > Hi Matt, Thanks for your suggestions. > Two suggestions. > > First, something like: > > freqvalues = getproperty('modelInfo.models.modelProperties.FreqValue') > > will look for frequency values of all models and put them in the array >

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Latévi Max LAWSON DAKU
On 07. 07. 16 17:04, Herráez Sánchez Ángel wrote: > Hi Max > Hi Herráez, Thanks for your mail > > I also have trouble often using variables. > > @{i} is unusual to me. The common syntax is either "i" or "@i " > :) I'm never sure when to use this; if using the bare name 'i' doesn't work, i

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Herráez Sánchez Ángel
Hi Max I also have trouble often using variables. @{i} is unusual to me. The common syntax is either "i" or "@i " Have you tried ...? print getproperty('modelInfo.models[@i].modelProperties.FreqValue')

Re: [Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Kubasik, Matthew A.
Max, Two suggestions. First, something like: freqvalues = getproperty('modelInfo.models.modelProperties.FreqValue') will look for frequency values of all models and put them in the array "freqvalues". Unfortunately, this array will have empty entries for models lacking frequency values.

[Jmol-users] Use of variable in a call to getProperty

2016-07-07 Thread Latévi Max LAWSON DAKU
Dear Jmol users/developers, I would like to be able to use a variable in a call to getProperty. So far, the following command works. $ print getproperty('modelInfo.models[7].modelProperties.FreqValue') 129.529358 But I rwould like to use a variable as follows $ i=7 $ print