Jump to content

Recommended Posts

Posted (edited)

#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
  • Moderators
Posted

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.

Posted (edited)

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
Posted

#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

Posted

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.

Posted

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

Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...