I have a numeric value which is used each time the program runs to automatically number items in a database file. I can easily convert from string to numeric using val() and from numeric back to string with str$(). However, I need the resulting string to always have exactly 6 characters, e.g., 000742 and not just 742.
I did a simple while-wend loop after converting back to the string:
while len(n$) < 7
n$="0"+n$
wend
This results in, for example, n$ = 00 742
I've done this before (many years ago) so I know it's possible - just can't remember how I solved this.
Thanks in advance for the assist.
Tom
I did a simple while-wend loop after converting back to the string:
while len(n$) < 7
n$="0"+n$
wend
This results in, for example, n$ = 00 742
I've done this before (many years ago) so I know it's possible - just can't remember how I solved this.
Thanks in advance for the assist.
Tom