Jump to content
Sign in to follow this  
HanamichiSakuragi

Add char to string

Recommended Posts

HanamichiSakuragi

Hi everyone

I used _HexToString UDF but it's return a cut-off string, so i make a new function like this

Func HexToString($string)
    Local $text = ""
    Local $i, $iDec, $Char, $iHex
    For $i = 0 To StringLen($string) Step 2
        $iHex = StringMid($string, $i, 2)
        $iDec = Dec($iHex)
        $text &= Chr($iDec)
    Next
    Return $text
EndFunc

And i 've tested it with this call:

$test = HexToString("28985DDDD5D6A697DC8C5BDEDCAD09DDDC1A3AF7DCD36FCFDEB0E0ADDC46EFDCDCF183DFDCBC98DADC6B91CDDC67CEDD

DC33ADDCDC4263D0DD18D45FDED990D9DC9D22DEDCD3B1CFDC75D02BDC1CDEDCDCB30CCDDC68E3EBD08F81CCDC9D524EDC4B

ACDCDCBF34F8DC396AB7DC0F226EDCC7"))

But it return a empty string ;)

Does anybody know how to fix it, please .

Share this post


Link to post
Share on other sites
picaxe

This works for me

#Include <String.au3>
$test = _HexToString("28985DDDD5D6A697DC8C5BDEDCAD09DDDC1A3AF7DCD36FCFDEB0E0ADDC46EFDCDCF183DFDCBC98" _
    & "DADC6B91CDDC67CEDDDC33ADDCDC4263D0DD18D45FDED990D9DC9D22DEDCD3B1CFDC75D02BDC1CDEDCDCB30CCDDC6" _
    & "8E3EBD08F81CCDC9D524EDC4BACDCDCBF34F8DC396AB7DC0F226EDCC7")
ConsoleWrite($test & @LF)

Share this post


Link to post
Share on other sites
HanamichiSakuragi

I updated the AutoIT to newest version and _HexToString() UDF working now.

Thanks for help ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×