Noob simple question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Richhpcnec
    New Member
    • Jan 2008
    • 1

    Noob simple question

    I have two text strings that I have read from a text file. The text strings that I have read are the 8 characters each, 859c58d4 and 80434d43. I have assigned them the varible names of string1 and string2.

    This text strings in reality represent hex values.

    How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

    Please help a noob trying to learn VB6.

    Rich
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Originally posted by Richhpcnec
    How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

    Rich
    For Converting strings into integers etc we use "Cint(strin g)"
    You can find a list of other "converters " in the object library type in "C" and you should find lots.....i believe there is one for hex

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Not sure what the size limits might be, but in the past I have used Val("&h" & String).

      Comment

      • werks
        New Member
        • Dec 2007
        • 218

        #4
        Originally posted by Richhpcnec
        I have two text strings that I have read from a text file. The text strings that I have read are the 8 characters each, 859c58d4 and 80434d43. I have assigned them the varible names of string1 and string2.

        This text strings in reality represent hex values.

        How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

        Please help a noob trying to learn VB6.

        Rich

        Hi there!

        Are you trying to Subtract the Value String1 = 859c58d4 and String2 = 80434d43

        You can CInt(string1) - CInt(String2), but the problem is there are alphabetical letters in the strings, so i think it will prompt you an error.. What does c and d do in 859c58d4 (-.-)???


        Better Than Yesterday

        Comment

        Working...