Results 1 to 5 of 5

Thread: show data from hex address

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Tiel, Gld, Netherlands
    Posts
    11

    Post

    Hello,

    I've a dBase III database, in that database there is in HEX a reference to an other file.
    This referencefield contains the following 7 bytes: 00 4b 00 25 c9 00 00
    The 3rd and 2nd position is the hex value of the length and the 5th and 4th character is the hex value of the starting point in the reference file.
    I've in my form somewhere a textbox to display the contents of this variable. But because the first character is allways hex(00) it always shows me an empty string.
    I want to pass the complete string of 7 bytes to a piece of code which will read the textdata from the referenced file.

    Peter van Collenburg
    [email protected]

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,
    I'm not sure what your trying to do but, having worked with hex numbers in the past, this might help. I'm guessing that from the hex string you supplied (00 4b 00 25 c9 00 00) that the file is 75 bytes in length with a starting point of 51493. 004b being the length and c925 being the starting point.
    The formula to convert 8 bit (1 byte) to 16 bit numbers is ((byte1 * 256) + byte2).
    Al.



    ------------------
    A computer is a tool, not a toy.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Tiel, Gld, Netherlands
    Posts
    11

    Post

    Hi Al,

    In my database there is on every record another the start and length pointer into the reference file, they are infact parameters into a large memofile.
    What I want to do is to get somehow in VB this complete string of 7 bytes, including the hex(00) byte, and pass it to a function which will read the memofile.
    At the moment VB thinks that my string is empty due to the hex(00) byte.
    Must I directly pass the database field context to the translate / read function?
    If so do you have a kind of example?

    Regards, Peter van Collenburg

  4. #4
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,
    Maybe you can get an idea from this.

    Here's a sub I threw together that creates a string of hexadecimal numbers then reads this string and returns the raw string, the hex values in the string and the decimal values in the string.
    The hex 00 at the beginning of the string didn't affect it.
    Al.

    Sub Main()
    strHex = Chr(&H0) & Chr(&H4B) & Chr(&H0) & Chr(&H25) & Chr(&HC9) & Chr(&H0) & Chr(&H0) 'Creates a string of hexadecimal numbers
    For x = 1 To Len(strHex)
    strHexadecimal = strHexadecimal & Hex(Asc(Mid(strHex, x, 1))) 'Reads the hex string and returns hexadecimal
    strDecimal = strDecimal & Str(Asc(Mid(strHex, x, 1))) 'Reads the hex string and returns decimal
    Next x
    Debug.Print strHex 'Prints the raw hex string
    Debug.Print strHexadecimal 'Prints the returned hexadecimal string
    Debug.Print strDecimal 'Prints the returned decimal string
    End Sub


    ------------------
    A computer is a tool, not a toy.

  5. #5
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    Peter,

    I had a similar problem with an old xBase database (developed using Clipper) that used a product called Flexfile as a replacement for the memo field data type. The pointer to the memo text was stored in a 6 byte field of string (character) data type. When I attempted to work with this database using Visual Basic, I ran into the same problem that you did. However, because the database was to be converted to MS Access, I didn't give much thought to the problem. All I needed to do was convert the memo file and tables over to a format that could be imported into MS Access--namely Foxpro dbf/fpt files. Is conversion to another database an option for you?

    Sorry I couldn't be of more help,
    Gerald M.

Posting Permissions

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



Click Here to Expand Forum to Full Width