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
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