VB How-ToAsk your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Please help me debug this problem. The error was the subscript was out of range. here is the code:
Thank very much. The Idea seem to work but I have another problem. The value of -1 is not acceptable index for an array.
After I run the code I get this error : "subscript out of range"
Here is the part of the code that with the error:
ReDim arrArrTestNewValue(UBound(arrArrayTest))
For n = 0 To UBound(arrFields)
For I = 0 To UBound(arrArrayTest)
If arrArrayTest(I, 0) = arrFields(n) Then
arrArrTestNewValue(I) = n
Else
arrArrTestNewValue(I) = -1
End If
Next I
Next n
Do While inFile.AtEndOfStream = False
record = inFile.ReadLine
arrFields = Split(record, Separator)
Dim k As Integer
If arrArrTestNewValue(k) = -1 Then arrFields(arrArrTestNewValue(k)) = ""