Eric132 0 Newbie Poster

Hi Guys,

I am using VB.NET Express Edition 2005

I have a multidementional array. The array is an index into a very large Text file that contains Books, Chapters and Verses. Each record in the index is made up of these fields.

Address, Book Number, Chapter Number, Verse Number, Bytes in the Verse.

The 'Address' is the address in the Text file where that particular Book starts.
The 'Book Number' is the number of a particular Book. etc., etc..

I would like to be able to iterate through the index util I reach the Book, Chapter, and Verse selected by the User so that I can pick up the address of the actual verse in the Text file. Then I will display the Verse in a RichTextBox.

I have tried doing nested 'For Next' Loops, but the compiler does not like it.This is what I have tried so far.

For each hi in HindexData 'Name of the array
If BookIndexNum = hi.BookNum Then <--- This line gets me to the start of the Book okay

For Each hi in HindexData <---- ERROR hi already in use by an enclosing For loop

If ChaptNum = hi.ChapterNumber Then
For Each hi in HindexData

If VerNum = VerseNumber Then
AddressH = Address <---- Start of Verse address, found Hopefully!!!!
Exit For
Next
End If
Next
End If
Next


Would anyone be able to assist me in this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.