VMD-L Mailing List
From: lily jin (lily1907_at_yahoo.com)
Date: Thu May 03 2007 - 18:49:47 CDT
- Next message: Lutz Maibaum: "Reading additional atom properties"
- Previous message: lily jin: "loop in loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
There must be a space between } and {
for {set j 0} {$j < 3} {incr j 1}{ is wrong
for {set j 0} {$j < 3} {incr j 1} { is right
Thanks
Lily
----- Original Message ----
From: lily jin <lily1907_at_yahoo.com>
To: VMD-L <vmd-l_at_ks.uiuc.edu>
Sent: Thursday, May 3, 2007 4:41:04 PM
Subject: loop in loop
Hi,
While I write a TCl script, it is not working to have a loop in a loop, for example
for {set i 0} {$i < $n1 } { incr i 1} {
set i1 [lindex $OXY $i]
set sel [atomselect top "index $i1" ]
set atom1 [measure center $sel]
puts " $i $i1 $atom1"
for {set j 0} {$j < 3} {incr j 1}{
puts $j
}
}
or:
for {set i 0} {$i < $n1 } { incr i 1} {
set i1 [lindex $OXY $i]
set sel [atomselect top "index $i1" ]
set atom1 [measure center $sel]
puts " $i $i1 $atom1"
set j 0
while {$j < 3 }{
puts $j
incr j
}
}
Lily
Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
- Next message: Lutz Maibaum: "Reading additional atom properties"
- Previous message: lily jin: "loop in loop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]