Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileGet error using random access file

Status
Not open for further replies.

jlkidd

Programmer
Feb 22, 2001
28
0
0
US
For some reason, I am receiving the error, "Index is outside the bounds of the array." I would assume this would mean that my text file is empty and since I am referencing a record in that text file. But I know it is not. In fact it contains over 100,000 lines.

My code is this:

Dim PSStructure As sttPS
Try
Dim fileNumber As Integer
fileNumber = FreeFile()

FileOpen(fileNumber, "c:\imperialpsmstr.txt", OpenMode.Random, OpenAccess.ReadWrite, OpenShare.Default, Len(PSStructure))
FileGet(fileNumber, PSStructure, 1)

Catch
MsgBox(Err.Number & vbCrLf & Err.Description & vbCrLf & Err.HelpContext)
End Try

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top