doubt reading file
#1

hi,

 

now i am trying to read a file, but the problem is that at the start of the file, you can the last index of the pet/item/skill...

 

and the really problem is that at the start i can read, for example 400, but there are only 50 notices/pets/skills and i dont know how to use EOF because i use this to open file:

 

ofd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.Desktop
            ofd.Filter = "file|file*.[CeNsOrEd]"
            result = ofd.ShowDialog
            If ofd.FileName <> Nothing Then
                Dim fs As New FileStream(ofd.FileName, FileMode.Open)
                Dim br As New BinaryReader(fs)

 

so i dont know how to read until the end of file.

 

 

could anyone help me please?

 

thanks in advance

#2
Im not familiar with visual basic (i assume this is what you are using?), but what about a while loop? "While the index read isnt the one from the beginning (in other words, the last one), read the file."

#3

Im not familiar with visual basic (i assume this is what you are using?), but what about a while loop? "While the index read isnt the one from the beginning (in other words, the last one), read the file."

 

yes, i use vb.

 

you are right. i havent thought on that. i think that i also have to put a condition because index go from 1 to 50 and then jump to 200, so i think i also have to put a condition to compare index of the item with the number i get at the start of the file.

 

thanks, i will try it Smile



Forum Jump:


Users browsing this thread: 1 Guest(s)