piccaso Posted April 15, 2007 Posted April 15, 2007 i'm a bit stuck here:$test = Binary("Hello") ConsoleWrite($test & @LF) ; Prints 0x48656C6C6F ConsoleWrite(String($test) & @LF) ; Prints 0x48656C6C6F too, why ? $struct = DllStructCreate("byte Buff[5]") $struct.Buff = $test ConsoleWrite($struct.Buff & @LF) ; ok 0x48656C6C6F again... $struct2 = DllStructCreate("char zBuff[6]",DllStructGetPtr($struct)) ConsoleWrite($struct2.zBuff & @LF) ; Prints Hello" but why " ConsoleWrite(StringLeft($struct2.zBuff,BinaryLen($test)) & @LF) ; Finally prints Hello :) any idea how to convert a Binary back into a string? maybe a bit easier than i did it CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
PsaltyDS Posted April 16, 2007 Posted April 16, 2007 ; Test convert Binary to String #include <string.au3> $HexString = _StringToHex ("This is a test, it is only a test...") ConsoleWrite("Hex string: " & $HexString & @LF) $String = _HexToString ($HexString) ConsoleWrite("Text string: " & $String & @LF) Dog ate your help file...? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
piccaso Posted April 16, 2007 Author Posted April 16, 2007 i dont get it. how does that work with Binary() Bad doggy, no bones for you in the next 500 decades... CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
PsaltyDS Posted April 16, 2007 Posted April 16, 2007 Sorry, missed a step... #include <string.au3> $Bin = Binary ("Hello") ConsoleWrite("$Bin = " & $Bin & @LF) $Hex = Hex($Bin) ConsoleWrite("$Hex = " & $Hex & @LF) $Text = _HexToString($Hex) ConsoleWrite("$Text = " & $Text & @LF) Doggy wants his bone! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
piccaso Posted April 16, 2007 Author Posted April 16, 2007 thanks Doggy died. Helpfile was poisoned CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
pdaughe Posted May 19, 2007 Posted May 19, 2007 i'm a bit stuck here:$test = Binary("Hello") ConsoleWrite($test & @LF) ; Prints 0x48656C6C6F ConsoleWrite(String($test) & @LF) ; Prints 0x48656C6C6F too, why ? $struct = DllStructCreate("byte Buff[5]") $struct.Buff = $test ConsoleWrite($struct.Buff & @LF) ; ok 0x48656C6C6F again... $struct2 = DllStructCreate("char zBuff[6]",DllStructGetPtr($struct)) ConsoleWrite($struct2.zBuff & @LF) ; Prints Hello" but why " ConsoleWrite(StringLeft($struct2.zBuff,BinaryLen($test)) & @LF) ; Finally prints Hello :) any idea how to convert a Binary back into a string? maybe a bit easier than i did it Just upgraded to AutoIt v3.2.4.4 and now I'm stuck too! The CoProc functions do not seem to work with 3.2.4.4. Obviously, BinaryString has to be changed to Binary, but the String function doesn't seem to work as expected as noted in this thread. I would hope we don't have to use _HexToString on the received parameter...(I can't get that to work either). Is anyone else experiencing this problem with 3.2.4.4? Thanks, Paul
SkinnyWhiteGuy Posted May 19, 2007 Posted May 19, 2007 As reported by SmOke_N:http://www.autoitscript.com/forum/index.php?showtopic=45739
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now