simple itterative loop + something a bit harder

Slayboy

Registered User.
Local time
Today, 15:34
Joined
Apr 28, 2004
Messages
28
I have 2 problems, I need to set up an itterative loop that does these calculations:

Values(0) = rec.Fields("0")
Values(1) = rec.Fields("1")
Values(2) = rec.Fields("2")
Values(3) = rec.Fields("3")
Values(4) = rec.Fields("4")
Values(5) = rec.Fields("5")
Values(6) = rec.Fields("6")
Values(7) = rec.Fields("7")
Values(8) = rec.Fields("8")
Values(9) = rec.Fields("9")

but where it goes up to a specified number, not just 9. So like do until Number = MaxNumber

Values(Number) = rec.Fields("Number")

with a given MaxNumber.

My other problem is for the IRR process that this is calculating I have to have a dim at the beginning:

Static Values(10) As Double

where the "10" is variable depending on MaxNumber, so I need to insert a number into the brackets but I'm having so much trouble I think due to it being a Dim statement?

Can anyone help me with either or both problems?

Many Thanks,
Matt.
 
you need the redim statement

Dim myarray() as integer

redim myArray(Max)

this is type of loop

dim intCounter as Integer

For intCounter=1 to MaxNumber
'your processing here
next
 

Users who are viewing this thread

Back
Top Bottom