From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Fri Apr 18 2014 - 17:49:32 CDT

Hi Erik,

You want format command:

set test [format "This is a 0-padded integer of length 5: %05d" 1]
puts $test

"printf" isn't strictly speaking a tcl command, but I believe it was
added into VMD because people wanted/were used to it instead of "format".

-Josh Vermaas

On 04/18/2014 05:05 PM, Martin, Erik W wrote:
> Can anyone help me understand why something like
>
> Set test [printf %05d 1]
>
> Works on the tk console command line, but when I run the same thing in a .tcl script it get the error:
>
> "invalid command name"
>
> Thanks,
> Erik
>
> ________________________________
> Email Disclaimer: www.stjude.org/emaildisclaimer
> Consultation Disclaimer: www.stjude.org/consultationdisclaimer
>
>