I know it's not terribly clear, but you can't use variables within 
select commands like that. Probably not worth it to explain why -- this 
has to do with how exactly commands are proccessed. In any case, you can 
construct and execute any command you like using the script() function:

  load =1crn.pdb
  myNum = 12;
  x = script("select " + myNum)

 > 8 atoms selected

This then removes all need for "@variableName" in a command, and it's 
necessary for the script command itself.

That said, in any select command were there is a numerical check, such as:

select resno=12

THERE you can use a variable directly, without @:

  myNum = 12;
  select resno=myNum

 > 8 atoms selected

select resno < myNum
 > 76 atoms selected

So that's even better in this case. Possibilities include those listed 
in the table starting with "ATOMNO" at

http://chemapps.stolaf.edu/jmol/docs/?ver=11.2#atomexpressions


Bob

Frieda Reichsman wrote:

> Hi,
>
> Can a variable be used for a residue number in a select command?
>
> When I try:
>
> myNum = 112
> select @myNum
>
> Jmol selects zero atoms (in a file where there is a residue 112).
>
> Frieda
>
>
>
> ///////////////////////////////////////////
>
>
> Frieda Reichsman
>
> Molecules in Motion
>
> Interactive Molecular Structures
>
> http://www.moleculesinmotion.com
>
>
> ///////////////////////////////////////////
>
>
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to