From: Felipe Merino (felipe.merino_at_mpi-muenster.mpg.de)
Date: Thu Jun 11 2015 - 06:50:13 CDT

You have an extra set instruction before the last two closing braces.

Felipe

On 11/06/15 12:56, Mehdi Bagherpour wrote:
> Dear vmd users,
>
> I have written a code that compute distance between atoms (Thanks for
> helping Dr.Axel Kohlmeyer for helping to write that).
>
> I want to write output file like this:
>
> First_atom_name second_atom_name distance
> but when I run my script it gives:
>
> *wrong # args: should be "set varName ?newValue?"*
>
> my script is:
>
> *set output [open "Distance.dat" w] *
> *for {set x 0} {$x <= 10} {incr x} {*
> *
> *
> *set sel1 [atomselect top "index $x"] *
> *set sel2 [atomselect top "index 1"] *
>
> *set nf [molinfo top get numframes] *
> *
> *
> *set s1_name [$sel1 get name]*
> *set s2_name [$sel2 get name]*
> *
> *
> *for {set i 0} {$i < $nf} {incr i} { *
> *$sel1 frame $i*
> *$sel2 frame $i*
> *
> *
> *set distance [veclength [vecsub [lindex [$sel1 get {x y z}] 0]
> [lindex [$sel2 get {x y z}] 0] ]] *
> *puts $output "$s1_name \t $s2_name \t $distance"*
> *set *
> *}*
> *}*
> *close $output*
> *
> *
>
> I will be appreciate If you could help me to find the bug of my script.