smiley Posted August 2, 2004 Share Posted August 2, 2004 I've been writing some code and need to write ASCII NULL (Hex 0x00) to a file. Now as I see it the FileWrite($file, Chr(0)) should do this but when executed actually writes nothing to the file. FileWrite($file, Chr(1)) and does work properly writing hex 01 to the file. I have also tried FileWrite($file, 0x00) which ends up writing a decimal 0 (Hex 0x30) to the file and not the intended NULL. Is this a bug or is there another way I'm not aware of? Thanks smiley Link to comment Share on other sites More sharing options...
flyingboz Posted August 2, 2004 Share Posted August 2, 2004 functions as designed. search for (the many many ) threads explaining why. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
ezzetabi Posted August 3, 2004 Share Posted August 3, 2004 you may find interesting:http://www.autoitscript.com/forum/index.php?showtopic=3905 Link to comment Share on other sites More sharing options...
smiley Posted August 3, 2004 Author Share Posted August 3, 2004 Thank you flyingboz, I did a search before I wrote this but did not see anything on Nulls, obviously there was. Thank you very much ezzetabi, that is a perfect thread of a work around. In my case it would be iffy to use that since Im writing random hex values to a file of which could be nulls. I guess if Im writing a null to a file I could write lets say a unique sequence of characters (more than a few to be sure) instead which I could afterwards swap out for a null. Reading nulls back from a file seems possible with Autoit at least one character at a time which is fine so Ill give it a try. A backup option is to just write it in C which is my favourite language but I do love Autoit to quickly get an idea off the ground and automate testing programs. smiley 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