Charly Posted March 3, 2006 Share Posted March 3, 2006 Hi all, I'm trying to create a binary file and somo of the data I have to write is NULL, (0x00h). I mean, that I need to write Hexadecimal numbers and when I have to write a value 0 it isn't written. The line I use is: FileWrite($file1, Hex(0)) Does anyone have written a Binary file using Autoit?. Thanks in advance, Charly (Madrid - Spain) Link to comment Share on other sites More sharing options...
nfwu Posted March 3, 2006 Share Posted March 3, 2006 Maybe try FileWrite($file1, Chr(0)) instead? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Charly Posted March 3, 2006 Author Share Posted March 3, 2006 Maybe tryFileWrite($file1, Chr(0))instead?#)Thank you nfwu but it's exactly the same.When you try to write any tipe of data with the value 0, (Hex(0), Dec(0), Chr(0)) it doesn't run. Link to comment Share on other sites More sharing options...
GaryFrost Posted March 3, 2006 Share Posted March 3, 2006 in the beta there is BinaryString( expression )Returns a binarystring might be something to look at SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nfwu Posted March 3, 2006 Share Posted March 3, 2006 So Chr(0) won't work on it's own. But if I do "a"&Chr(0)&"b", the Chr(0) DOES appear between the "a" and the "b" maybe that should help? (""&CHR(0)&"" DOES NOT work.) #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Charly Posted March 3, 2006 Author Share Posted March 3, 2006 So Chr(0) won't work on it's own.But if I do "a"&Chr(0)&"b", the Chr(0) DOES appear between the "a" and the "b"maybe that should help?(""&CHR(0)&"" DOES NOT work.)#)No, I tried it and writes a and b but not the NULL char.It writes byte by byte and when it finds a 0 value it ignores it. Link to comment Share on other sites More sharing options...
nfwu Posted March 3, 2006 Share Posted March 3, 2006 Very interesting.... Must be a bug somewhere, the help file (indirectly) said "a"&Chr(0)&"b" works... ??? #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
GaryFrost Posted March 3, 2006 Share Posted March 3, 2006 Very interesting.... Must be a bug somewhere, the help file (indirectly) said "a"&Chr(0)&"b" works...???#) Might want to make sure your both using the same version before calling it a bug, far as I know that is in the beta help, not the release help SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 3, 2006 Moderators Share Posted March 3, 2006 EchoEchoEchoEcho Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted March 3, 2006 Share Posted March 3, 2006 EchoEchoEchoEcho Was wierd, only hit submit 1 time, oh well SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Charly Posted March 3, 2006 Author Share Posted March 3, 2006 Very interesting.... Must be a bug somewhere, the help file (indirectly) said "a"&Chr(0)&"b" works...???#)Thank you for your interest any way.I'll report it as a bug and I'll try the new Binary options in the beta version.See you around. Link to comment Share on other sites More sharing options...
Charly Posted March 3, 2006 Author Share Posted March 3, 2006 Might want to make sure your both using the same version before calling it a bug, far as I know that is in the beta help, not the release helpThanks gafrost, I've tried all the conbinations with the FileWrite command and it's thought only for text files.I'll try the binary function you told me and I'll tell you something about it.Thanx 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