Hexa to Val

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
SPH
Enthusiast
Enthusiast
Posts: 588
Joined: Tue Jan 04, 2011 6:21 pm

Hexa to Val

Post by SPH »

Code: Select all

; Les nombres en hexa peuvent être définis sur 1,2,4,8 ou 16 1/2 octets en ascii ou 4,8,16,32,ou 64 bits
;;;;;   123456789ABCDEF0123456789ABCDEF0 
texte$="01020345f8c6deffcb0F0345f8c6defE"
; Debug mp_h(@texte$,64,222)
longtxt=Len(texte$)
lndecoupe=1
Repeat 
  Debug "************  decoupe par "+Str(lndecoupe)+"  *************"
  i=1
Repeat
  a$="$"+Mid(texte$,i,lndecoupe)
  Debug a$+" = "+Str(Val(a$))
  i+lndecoupe
Until i>longtxt
lndecoupe*2
Until  lndecoupe>16

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
idle
Always Here
Always Here
Posts: 6011
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Hexa to Val

Post by idle »

also here but note byte order is reversed
viewtopic.php?t=83378
Post Reply