Jump to content
Sign in to follow this  
somh

About APIFileReadWrite.au3

Recommended Posts

somh

#include <APIFileReadWrite.au3>

Func BinWrite($fName)
    $h = _APIFileOpen($fName)
    $g = FileGetSize($fName)
    $r = _APIFileRead($h,3,1)
    if $r = "EF,BB,BF" then
        _APIFileSetPos($h,0)
        _APIFileWrite($h,"0D,0A,0D",1)
    endif
    _APIFileClose($h)
EndFunc

BinWrite("c:\xxxxx\xxx.ini")

I'm using the latest beta AutoIt and my OS is Win 2k pro en.

When I simply run the script it's working fine, but when it's compiled into an exe file, the error shows up:

Edited by somh

Share this post


Link to post
Share on other sites
SmOke_N

Might be a silly question, but are you using "Beta Compile"?


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.

Share this post


Link to post
Share on other sites
LxP

It may or may not have something to do with this:

07th September, 2005 - v3.1.1.74 (beta)

  • Changed: Set _ to be a continuation character only after whitespace. It does not matter if a comment follows the continuation character or not. \ is not a continuation character. (by Nutster)
Edit: This of course suggests that you place a space before any underscores at the end of a line within the mentioned #include file. Edited by LxP

Share this post


Link to post
Share on other sites
Valuater

#include <APIFileReadWrite.au3>

Func BinWrite($fName)
    $h = _APIFileOpen($fName)
    $g = FileGetSize($fName)
    $r = _APIFileRead($h,3,1)
    if $r = "EF,BB,BF" then
        _APIFileSetPos($h,0)
        _APIFileWrite($h,"0D,0A,0D",1)
    endif
    _APIFileClose($h)
EndFunc

BinWrite("c:\xxxxx\xxx.ini")

I'm using the latest beta AutoIt and my OS is Win 2k pro en.

When I simply run the script it's working fine, but when it's compiled into an exe file, the error shows up:

I have found that some of the includes utilize single letter variables or varaiables names similar to what you are using.... so... you could try changing the variable names..... just an idea. you could check the include files for a similar situation as i have stated

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
somh

Still the script is running OK, but the exe isn't.

Thanks for all your help, but after many tests I have to give up.

Share this post


Link to post
Share on other sites
LxP

But did you go through your copy of APIFileReadWrite.au3 and add a space before any line-terminating underscore as suggested?

Share this post


Link to post
Share on other sites
somh

But did you go through your copy of APIFileReadWrite.au3 and add a space before any line-terminating underscore as suggested?

Due to some other mistakes, I didn't realize that the problem has been solved already.

Thanks again.

;)

I think we should inform Lar to update his attached file.

Share this post


Link to post
Share on other sites
LxP

No problem -- glad I reached you before you abandoned the thread for good! ;)

Yes, the sooner the file is updated the better because it will minimise the impact that this issue may have.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.