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&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisc

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 getproperty('modelInfo.models[7].modelProperties.FreqValue') > 129.52935

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 Sánc

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 synta

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 swi

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 g