ok, here is the snippet of code that does the counting in my VB6 program. There are also comments at the end of all lines (did that for XcOM so he could see what I was doing)
Code:
Private Sub cmdStart_Click() 'start button
lblStatus.BackColor = RGB(255, 0, 0) 'make statuslabel red
lblStatus.Caption = "Counting..." 'print busy text
DoEvents 'give windows time to do things (writing in the label)
x = 0 'set startpoint to 0
Finish = Val(txtFinish.Text) 'read endpoint from textbox
ReDim Numbers(1 To Finish) As Long 'ready the array for input
StartTime = timeGetTime 'read the time (starttime)
Do Until x = Finish 'count until x = finish (the number from the textbox)
x = x + 1 'add one to x
Numbers(x) = x 'store x in the array
Loop 'loop the counting
EndTime = timeGetTime 'when finished, get time again (endtime)
TimeTaken = EndTime - StartTime 'calculate time taken
lblStatus.BackColor = RGB(0, 255, 0) 'make statuslabel green and
lblStatus.Caption = "Done!, Numbers stored in array, idle" 'print done text
lblOutput.Caption = Finish & ": " & TimeTaken & "ms" 'print the result to the label
End Sub 'end counting sub
as you can see the numbers are stored in an array. My program also had a display-button, that let's you display the numbers in the array (code not in here)
enjoy