From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Aug 08 2011 - 22:37:15 CDT

The incr command only works on integers, but you are trying to use it
for accumulating floating point numbers. This cannot work and thus you
get a deserved error message from tcl.

Axel

On Aug 8, 2011, at 7:04 PM, KIRTANA S <skirtana4_at_gmail.com> wrote:

> I am using the following script
>
> set nf [molinfo top get numframes]
> set sum 0
> for {set x 0} {$x < $nf} {incr x 100} {
> for {set i 196} {$i <295} {incr i} {
> set sel1 [atomselect top "resid 1 to 195"]
> set com {}
> lappend com [measure center $sel1 weight mass]
>
> set sel2 [atomselect top "resid $i"]
>
> set com2 {}
>
> lappend com2 [measure center $sel2 weight mass]
>
> if {$i != 295} {
> incr sum [veclength2 [vecsub [lindex $com2 0] [lindex $com 0]]]
> }
> set dist [expr sqrt($sum/100)]
> puts $outfile "$x $dist"
> $sel2 delete
> }
> $sel1 delete
> }
>
> returns me an error as expected integer got "573.12".
> Please help me to rectify this.If details required let me know
>
> Thanks
> kirtana