Results 1 to 4 of 4

Thread: minus hex from each byte in string how?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    9

    Exclamation minus hex from each byte in string how?

    i want to - a certain amount from each hex from a hex STRING...

    for example... 9E0506 - 9F =

    9E - 9F = FFFFFFFFFFFFFFFF (so FF)
    05 - 9F = FFFFFFFFFFFFFF66 (so 66)
    06 - 9F = FFFFFFFFFFFFFF67 (so 67)

    and the answer would be = FF6667

    if anyone can help me out making a program that can do this i would be greatful!!

    o yeah using vb6 here.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: minus hex from each byte in string how?

    Welcome to Forums, broomop!

    Here is something for you to start:
    Code:
    Private Sub Command1_Click()
        Text3.Text = Hex(HexToLong(Text1.Text) - HexToLong(Text2.Text))
    End Sub
    
    Function HexToLong(ByVal sValue As String) As Long
    '===================================================
    
        If UCase(Left(sValue, 2)) <> "&H" Then
            sValue = "&H" & sValue
        End If
        
        If Right(sValue, 1) <> "&" Then
            sValue = sValue & "&"
        End If
        
        HexToLong = Val(sValue)
    
    End Function

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    9

    Re: minus hex from each byte in string how?

    thanks that helped me out big time

  4. #4

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