From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Mon Jan 05 2015 - 00:50:46 CST

 

Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag von sunyeping
Gesendet: Montag, 29. Dezember 2014 08:23
An: vmd-l
Betreff: vmd-l: the usage of measure bond

 

Dear all,

 

I want to measure the distance of two atoms by the vmd command "measure bond". For example, the two atoms with their index being 10 and 20 respectively. By using the command:

 

measure bond {10 20}

 

I can correctly get the distance between these atoms, say 1.711A. However, I don't know how the use variable to replace the two numbers that represent the indexes of these atoms. For example, I set the two numbers to two variable, a and b:

 

set a 10

set b 20

 

then I use the command:

 

measure bond {$a $b}

 

try instead:

 

measure bond [list $a $b]

 

Norman Geist ;)

 

it returns the following error message: expected integer but got "$h" measure bond: bad atom index.

 

In TCL language, the varialbe replacement symbol "$" can not work in the curly brace ({ }), but measure bond definitely need the the curly brace . So how this conflict be solved?

 

Thanks in advance!

 

Yeping Sun

Institute of Microbiology, Chinese Academy of Sciences