Jump to content

About APIFileReadWrite.au3


somh
 Share

Recommended Posts

#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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

#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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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