EddieBoy Posted September 18, 2011 Share Posted September 18, 2011 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 $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 More sharing options...
ProgAndy Posted September 18, 2011 Share Posted September 18, 2011 (edited) 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 September 18, 2011 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 More sharing options...
EddieBoy Posted September 18, 2011 Author Share Posted September 18, 2011 That helps thanks- drove myself crazy trying to figure out what was going on Is there something I can change in the code to stop that from happening or should I fix it with something like BinaryMid($num,1,4)? Link to comment Share on other sites More sharing options...
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