OK that well cant be helped. It's no big deal - Speed was my only concern why I wanted to minimise looping if possible.
I have difficulty communicating. My fault not yours. I'll try again.
The method 1 (in my code on the OP) returns a long variable. Somehow this long represents 4 consecutive bytes in the file - exactly how this works I am not sure!(To illustrate by example - in the case of a JPEG, the first four bytes in the file have the hex values: FF D8 FF E0 ; And method 1 reads these as a long of -520103681 ?!)
The method 2 (in your example) returns a string of hex values.
Unfortunately I need method 2 to return a long variable - with same value as method 1. How can I do this?
(The reason why I need method 2 to return the same long as method 1 is because: Each long variable found is tested against another sub function to see if the long variable is the information that I am looking for. This function only accepts a long argument, not a string of hex values)
UPDATE: Solved.
The solution was staring me in the face. :slaps forehead: I overlooked the nuisance of Little Endian. In the case of the JPG - the hex values of FF D8 FF E0 - I needed to place them in reverse order then convert to long. i.e. FF D8 FF E0 -> &HE0FFD8FF -> Clng(&HE0FFD8FF) => -520103681 = Method 1 variable of -520103681
Thanks Kyle. I couldn't have made this connection without your help. +1
Bookmarks