The thread is now solved but in case anyone with the same problem (unlikely!) stumbles across this thread looking for a quick solution, here it is:
Replace this part of the code:
Seek #intFNum, lngReadPos
Get #intFNum, , lngResult
With the extract below
lngResult= fnlngBufferEquivalentToGETLong(avarBuffer, lngReadPos)
I have written a custom function to replace GET for longs. See below.
Private Function fnlngBufferEquivalentToGETLong(ByRef avarBuffer As Variant, ByVal lngReadPos As Long) As Long
'You can use Get function on an open file to read 4 bytes to a long variable from a Seek position
'This function is designed as an equivalent for when you use a Buffer arr instead
Dim strHexValue As String
strHexValue = "&H" & Hex(avarBuffer(lngReadPos + 3)) & Hex(avarBuffer(lngReadPos + 2)) & Hex(avarBuffer(lngReadPos + 1)) & Hex(avarBuffer(lngReadPos))
fnlngBufferEquivalentToGETLong = CLng(strHexValue)
End Function
You have permission to do what you want with the above function (yes, including commercial use) however: a) I would appreciate it if you didn't pass this off as your own work and b) blanket disclaimer - I offer no guarantee that it will work. You use it entirely at your risk. I accept no liability whatsoever and I do not take any responsibility for any damage/s - real or imagined - that you may incur etc.
Bookmarks