From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Dec 01 2005 - 14:34:46 CST

Hi,
  You'll need to use "" characters instead of {} if you want Tcl to
evaluate the $bin contained in your macro:
  set bin 3
  atomselect macro w1 "waters within $bin of protein"

  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Dec 01, 2005 at 02:09:07PM -0700, Anthony Cruz wrote:
> Hi:
> I am trying to calculate the amount of water inside and around a protein. I
> trying this :
>
> $bin is the variable that will be changing
>
> atomselect macro w1 {waters within $bin of protein}
> atomselect macro w2 {waters within 1.05 of w1}
> atomselect macro w3 {waters within 1.05 of w2}
> set binsel [atomselect top "w3" frame $i]
>
> when I try the first macro this is what I got:
>
> vmd>set bin 3
> 3
> vmd > atomselect macro w1 {waters within $bin of protein}
> syntax error
> ERROR) Macro 'waters within $bin of protein' cannot be parsed.
> Unable to create macro for 'w1'
> vmd >
>
> What could be the problem???
>
> Thanks
>
> Anthony

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078