Results 1 to 11 of 11

Get statement - Please help me understand how this works

Threaded View

mc84excel Get statement - Please help... 07-23-2015, 11:14 PM
mc84excel Re: Get statement - Please... 07-26-2015, 08:12 PM
Kyle123 Re: Get statement - Please... 07-27-2015, 07:04 AM
mc84excel Re: Get statement - Please... 07-27-2015, 08:11 PM
Kyle123 Re: Get statement - Please... 07-27-2015, 07:13 AM
mc84excel Re: Get statement - Please... 07-27-2015, 08:24 PM
Kyle123 Re: Get statement - Please... 07-28-2015, 03:41 AM
mc84excel Re: Get statement - Please... 07-28-2015, 06:22 PM
mc84excel Re: Get statement - Please... 07-28-2015, 08:45 PM
Kyle123 Re: Get statement - Please... 07-29-2015, 02:03 AM
mc84excel Re: Get statement - Please... 07-29-2015, 08:31 PM
  1. #8
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Get statement - Please help me understand how this works

    Quote Originally Posted by Kyle123 View Post
    No, you can't use method 2 without looping, it's a byte array - why do you not want to loop?
    OK that well cant be helped. It's no big deal - Speed was my only concern why I wanted to minimise looping if possible.


    Quote Originally Posted by Kyle123 View Post
    Ok, I still don't really get what you want. The first bit of data isn't a long?
    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
    Last edited by mc84excel; 07-28-2015 at 08:21 PM. Reason: reword for clarity

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IF AND statement that works across a huge number of rows
    By kcphila in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 07-10-2015, 01:09 PM
  2. [SOLVED] I want to understand what is behind A2 cell ? How this works ?
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 01:36 PM
  3. IF statement works for some but not all?
    By refryguy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-02-2014, 02:04 PM
  4. [SOLVED] If statement that only returns #value, however it works in another spreadsheet but has {}
    By michael_bemis2002 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2012, 03:56 PM
  5. Replies: 1
    Last Post: 09-18-2007, 02:07 PM
  6. [SOLVED] SUMPRODUCT statement only works sometimes
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2006, 12:55 PM
  7. Select case statement - it will not work and i dont understand why! :o(
    By Thomas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2005, 01:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1