10-01-2012, 02:52 PM
Well, first of all, you would need an integer variable to keep track of the number, so we can do this with something like this:
[code2=vbnet]Private Counter As Integer = 0[/code2]
Then, Every time we need to increment the variable, we can do so with:
[code2=vbnet]Counter += 1[/code2]
However, when we display the variable to the user, we would like it to be in the proper format. Since your number is 6 characters long, we pad left by 6 characters and fill any empty spots with 0s. Like so,
[code2=vbnet]Dim cString As String
cString = Counter.ToString.PadLeft(6, "0"c)[/code2]
Hopefully this helps.
[code2=vbnet]Private Counter As Integer = 0[/code2]
Then, Every time we need to increment the variable, we can do so with:
[code2=vbnet]Counter += 1[/code2]
However, when we display the variable to the user, we would like it to be in the proper format. Since your number is 6 characters long, we pad left by 6 characters and fill any empty spots with 0s. Like so,
[code2=vbnet]Dim cString As String
cString = Counter.ToString.PadLeft(6, "0"c)[/code2]
Hopefully this helps.