home bbs files messages ]

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,730 of 10,840   
   Raoul Watson to Antony Clements   
   Re: hex to byte   
   29 Mar 09 16:19:52   
   
   From: WatsonR@IntelligenCIA.com   
      
   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"   
      
   --- 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