Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

FileOpen normal vs "forced binary" question

$
0
0

I wrote a program that opens a data file in 'write mode append' (1), and reads fours bytes, one after the other, using a setup like this:
 

$read = "" For $i = 1 To 3 $read = Binary($read) & Binary(FileRead($file, 1)) Next

This part of the process would repeat every time the user pressed a "next" button. The program worked fine until I switched Windows to Japanese as the "language for non-unicode programs". Then the program started returning bogus read data in an intermittent pattern. This was fixed when I opened the file from which the data was being read in forced binary mode. 

I'm guessing that there's some sort of "text to binary" conversion that happens with  Binary(FileRead($x)) from a file opened in non-binary mode. And changing to Japanese hindered the conversion to Binary?

Can anyone explain why Binary(FileRead($x)) would return a blank value intermittently. Thanks  :)

 

EDIT: Example script below


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>