VMD Extension Functions
Iterate a TCL block over a set of files

Functions

 forFiles filename pattern block
 

Detailed Description

Iterator over files matched by the given pattern. The matched files are loaded in sequence, sorted in natural order, and the block is executed. When executing the block, the first argument is set to the current file name (note that, like for, it does not require the dollar symbol). Will discard currently-loaded frames!

For example:

1 forFiles fn {*.dcd} {
2  puts "$fn has [ molinfo top get numframes ] frames"
3 }

Function Documentation

◆ forFiles()

forFiles   filename pattern block  

Iterator over files matched by the given pattern sorted in natural order, and execute block. See detailed description above.

  forFiles fn {*.dcd} {
        puts "$fn has [ molinfo top get numframes ] frames"
  }