X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 May 2013 08:32 AM by  anon
Reading variables from byte array in memory
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:5
New Member


--
29 May 2013 08:32 AM
    Hello, I am trying to parse and read in a bunch of various (float, long, integer,..) variable values from known positions in a rather large byte array I have in memory. I can't seem to find a nice way of doing that other than reading and multiplying the byte values separately for each variable value. The reason I'm using an array in memory instead of reading the data directly from disk to the variables is that I have to massage the byte array first to remove errors etc. Any suggestions on how to achieve this would be appreciated. Cheers, Rainer

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 May 2013 09:45 AM
    I don't really follow how you are doing this, but the normal "casting" routines do this well: value = Float(array, knownPositionInArray)

    Deleted User



    New Member


    Posts:5
    New Member


    --
    30 May 2013 04:09 AM
    Thanks, that's exactly what I need. I had completely missed out that you can use the casting functions that way on an array of a different type. Cheers, Rainer
    You are not authorized to post a reply.