Originally posted by Johnny Anderson
CL v5.8, HL7 v2.5.1, Sun, Solaris 10.
I want a counter to look like this: 001, 002, 003, 004, etc. Will be used as part of a filename.
My code:
set filenamectr 001
@ 1st filenamectr: " $filenamectr
set filenamectr [format "%03s" $filenamectr]
incr filenamectr 001
@ 2nd filenamectr: " $filenamectr
Results:
@ 1st filenamectr: 001
@ 2nd filenamectr: 2
Found examples on the forum and tcl guides. One warned about math and octal. What