Jump to content

FileWrite with binary files.


Recommended Posts

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

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

#)

Link to comment
Share on other sites

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

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

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

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

Thanks 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

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