Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 10,733 of 10,840    |
|    Antony Clements to Raoul Watson    |
|    Re: hex to byte    |
|    29 Mar 09 21:26:26    |
   
   From: antony.clements@bigpond.com   
      
   "Raoul Watson" wrote in message   
   news:IcNzl.387$Q52.377@nwrddc02.gnilink.net...   
   > Antony Clements wrote:   
   >> I have a hex string consisting of 64 characters, and I want to take every   
   >> two characters and convert them to their respective byte value (eg FF =   
   >> 255). Is there a fast and eficient way of doing this, or does it have to   
   >> be done manually?   
   >   
   > I would use the VB internal ability to convert hex:   
   >   
   > Private Function Hex2Dec(h$) As Integer   
   > h$ = "&H" & h$   
   > Hex2Dec = Val(h$)   
   > End Function   
   >   
   > So you'll get 255 when you pass "FF"   
      
   Scratch my previous post, it all works now no matter what the data type the   
   output is.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca