From: Justin Gullingsrud (justinrocks_at_gmail.com)
Date: Tue Sep 21 2004 - 12:43:23 CDT

VMD always wraps the result of a [$sel get { x y}] in another list,
even if the list contains only one item. If you parse the result
with:

  foreach elem [$sel get { x y }] {
    # do stuff with $elem
  }

it will work no matter how many atoms are in $sel. Another way to go
is to use lindex to get the first element of $A1 and $B1, which
contain the vectors you expect.

Justin

On Tue, 21 Sep 2004 09:38:01 +0000, Jerry Ebalunode <jebalunode_at_uh.edu> wrote:
> Hi John,
>
> How do you correctly use the vecdist command to evaluate previously declared
> variables? When I use it get distances between atoms, I get a non-numeric in
> first arguement " error
> see my vmd log below
>
> vmd > set i 0
> 0
> vmd > set sel1 [atomselect top "index 9469" frame $i]
> atomselect40222
> vmd > set sel2 [atomselect top "index 11057"]
> atomselect40223
> vmd > set A1 [$sel1 get { x y } ]
> {-19.0349998474 6.21299982071}
> vmd > set B1 [$sel2 get { x y } ]
> {-16.7100009918 6.54000043869}
> vmd > set distA [ vecdist $A1 $B1]
> vecsub: non-numeric in first argument
> vmd > vecdist $A1 $B1
> vecsub: non-numeric in first argument
>
> --
> Jerry Ebalunode
> Ph.D. Candidate
> RM 402F Houston Science Center
> Phone: 713-743-8367
> Dept. of Biology and Biochemistry
> University of Houston
> 4800 Calhoun Road
> Houston, TX 77204
>

-- 
The spirit of Plato dies hard.  We have been unable to escape the
philosophical tradition that what we can see and measure in the world
is merely the superficial and imperfect representation of an
underlying reality.
                -- S.J. Gould, "The Mismeasure of Man"