Jump to content

Binary()


 Share

Recommended Posts

I'm getting lost with this new Binary function already

$Var1 = Binary(10)
 MsgBox(0, "test1", $Var1)
 $Var2 = String($Var1)
 MsgBox(0, "test2", $Var2)

I would think that it would return

1010

and

10

Instead it returns '°«9' and 0xB0AB3900

Actually, what is above is returned after using ClipPut functions...Even if it is broken or not, it shouldn't change the value of the variable...Even commenting them changes it...

$Var1 = Binary(10)
;ClipPut($Var1)   ;feel free to uncomment this command
 MsgBox(0, "test1", $Var1)
 $Var2 = String($Var1)
;ClipPut($Var2) ;feel free to uncomment this command
 MsgBox(0, "test2", $Var2)

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

I should have been more clear in the documentation Binary is changing the type from string to binary.

it usely has no conversion.

I test it carefully with string and I didn't pay attention to numbers. I will wait more post and improve what binary type conversion.

String when converting a binary object can return something like an hex representation which can go back to binary with a binary()

In your case the string representation of 10 is "10" so the binary should have been 0x3130. I understand it is not the case so I will try to have a coherent handling.

Perhaps I need to change the name of the function too to avoid confusion.

Thanks for your feedback.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...