Offset and Binary Data

Michael Doub mikedoub at gmail.com
Fri Jan 23 16:13:30 EST 2015


Can someone explain to me why the offset function is returning the same 
offset when the search criteria is different?

Put this into a button:

on mouseUp
    put numtochar(255) & numtochar(216) into tStart
    -- in Hexadecimal: FFD8 = SOI(Start of jpeg image)
    put numtochar(255) & numtochar(217) into tEnd
    -- in Hexadecimal: FFD9 = EOI(End of jpeg image)

    put "AAA" & tStart & "DATA"& tEnd & "BBB" into temp1
    put offset(tStart,temp1) into tThumbstart
    put offset(tEnd,temp1) into tThumbEnd
    answer "Start:" && tThumbstart & cr & "End:" && tThumbEnd
end mouseUp

I get 4,4.   Is this not the way to search thru binary data?

-= Mike





More information about the use-livecode mailing list