From: Alex Hummels (
Date: Thu Sep 05 2019 - 16:28:51 CDT

Hello all,

I’m encountering a weird error with tcl. I have a list valid_shells. When I use puts, I see that this list is

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 30 31

Now I have a for loop that iterates over this list and prints the value. This works until I get to the very last component, where I get the error

atomselect set: 0 data items doesn’t match 1 selected atoms.

In my actual script there is more that happens after this put statement, but none of it happens and the loop stops after this error. The loop I’m using that gives me this error is below. I’ve tried changing the loop from a foreach loop to a for loop, also below, but the error remains the same.

foreach nshell $valid_shells {
        puts $nshell

for {set nshell 1} {$nshell < 32} {incr nshell} {
        if {!($nshell in $valid_shells)} {continue}
        puts $nshell

The only other thing I can think of as pertinent is that the list valid_shells was initialized as an empty list, and these numbers were successively added with calls to lappend as below

lappend valid_shells $number

Any and all help is much appreciated.