From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Jan 13 2011 - 09:53:20 CST

Hi,
  When you run a script like that, you need to make sure you add "waitfor all"
to the end of the "mol new" and "mol addfile" commands, otherwise VMD
continues running the next commands in your script while it is still
in the process of loading the trajectory file in the background...
So, this is why only 8 frames are loaded when you run it without the
"waitfor all" option.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Thu, Jan 13, 2011 at 10:45:16AM -0500, dhacademic wrote:
> Hi VMD user,
>
> I meet the problem in extracting the number of frames from amber
> trajectory.
>
> Following is my script "myframe.tcl". When I run "vmd -e myframe.tcl", the
> calculated frame number is 8. But when I use the first two lines of the
> script to load the trajectory, and then type in the last four lines in TCL
> Console, the frame number is 1000. In reality, 1000 is the correct number.
>
> I want to know is there anything wrong?
>
> Best,
> Hao
>
>
> mol new out.top type parm7
> mol addfile out.mdcrd type crdbox
>
> proc myframe {{mol top}} {
> set num_steps [molinfo $mol get numframes]
> }
> myframe
>
>
> 2011-01-13
>
> ----------------------------------------------------------------------
>
> dhacademic

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078