Jump to content

binary() returning a 64bit value?


EddieBoy
 Share

Recommended Posts

I'm trying to calculate the size of a data block then write that value to a file in binary format. But binary() isn't behaving as I would expect and seems to be returning an 8 byte value. Here's a simplified example. Any advice on why this happens would be appreciated :graduated:

$Width = 0x100
$Height = 0x100
$BPP= 0x18
$Image_Data_Size =int($Width)*int($Height)*(int($BPP/8))
ConsoleWrite($Image_Data_Size & @CRLF)
ConsoleWrite(Binary($Image_Data_Size) & @CRLF)
ConsoleWrite(Binary(196608)& @CRLF)
Link to comment
Share on other sites

AutoIt changes the variable type automatically to int64 if is required. Maybe AutoIt thinks so in your case.

Edit: Yes this is the cause.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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...