Run Time Error 9 Subscript Out Of Range ....Help!

Obie
10-19-2000, 08:23 AM
I get a continual 'Run Time Error 9' Subscript out of range.

Private Sub Form_Load()
->ReDim title(1 To n) As String <--
ReDim author(1 To n) As String
ReDim bookNum(1 To n) As Single
ReDim catergory(1 To n) As String

Open "C:Andrejook.txt" For Input As #1
numbooks = 0
Do While (Not EOF(1)) And (numbooks < UBound(title))
numbooks = numbooks + 1
Input #1, title(numbooks), author(numbooks), bookNum(numbooks), catergory(numbooks)

What is this error and how do I fix other than limiting my array.

Regards
Obie

Helmar
10-19-2000, 09:47 AM
Maybe I'm missing something, but it seems to me you have to set the value of n to something before you do the REDIM's

The way it is now, your statement is:

Redim Author(1 to 0) As String


Helmar B. Herman, VP ProtoProducts

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum