Modify

Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#3109 closed Bug (No Bug)

2x FileInstall in same line (in if statement) not working compiled

Reported by: anonymous Owned by:
Milestone: Component: Aut2Exe
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

Hello,

the following code works fine:

If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "Error")

But in the compiled version the second file could not be installed.. Maybe the Aut2Exe dont include the second file??
Try it yourself, it wont work

Attachments (0)

Change History (13)

comment:1 by anonymous, 11 years ago

Here I got the evidence:

Version 1 not working:

If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "error")
Exit

Version 2 working:

If Not (FileInstall("a.txt", "a2.txt") And FileInstall("b.txt", "b2.txt")) Then MsgBox(0, "", "error")
Exit
FileInstall("b.txt", "b2.txt")

I added the third FileInstall. This line will not be excecuted but the Aut2Exe recognize the second file and the installation works!

comment:2 by anonymous, 11 years ago

It is a real bug.. See #3107
@AutoIt Support (or whatever): Please read the tickets in future carefully and not simply stamping a request as no bug. Thank you

in reply to:  2 ; comment:3 by Jos, 11 years ago

Replying to anonymous:

It is a real bug.. See #3107
@AutoIt Support (or whatever): Please read the tickets in future carefully and not simply stamping a request as no bug. Thank you

Trying to make friends or something?

Jos

in reply to:  3 comment:4 by anonymous, 11 years ago

Replying to Jos:

Replying to anonymous:

It is a real bug.. See #3107
@AutoIt Support (or whatever): Please read the tickets in future carefully and not simply stamping a request as no bug. Thank you

Trying to make friends or something?

Jos

Seriously not! I just wanna help to improve AutoIt and get answers like that..

comment:5 by b, 11 years ago

My guess is that the compiler looks at the first fileinstall and ignores the second because it's on the same line.
You should probably just not use this line in any script, there's nothing saying that it should work this way, so when it doesn't it's not really a bug but a design decision.

There's better ways of determining if the files exist than trying to see if the fileinstall failed. After all, the way you wrote it if the out file already exists it will give you an error message which is probably not what you're looking for in the script in the first place. One liner coding just makes things easier for the coder, not for the poor people that have to read this dreck later.

in reply to:  5 comment:6 by jen, 11 years ago

Replying to b:

My guess is that the compiler looks at the first fileinstall and ignores the second because it's on the same line.
You should probably just not use this line in any script, there's nothing saying that it should work this way, so when it doesn't it's not really a bug but a design decision.

There's better ways of determining if the files exist than trying to see if the fileinstall failed. After all, the way you wrote it if the out file already exists it will give you an error message which is probably not what you're looking for in the script in the first place. One liner coding just makes things easier for the coder, not for the poor people that have to read this dreck later.

comment:7 by jchd18, 11 years ago

Resolution: No Bug
Status: newclosed

This is due to boolean evaluation short-circuit. Look at Help > Language Reference > Operators and read at the bottom of the page.

No bug. And please guys, don't use Trac to chat about "issues", the help forum is the suitable place for that.

comment:8 by anonymous, 10 years ago

Sorry but you did not try it, right? This is a bug.. See the evidence.. It has to work..

comment:9 by jchd18, 10 years ago

Stop spamming this ticket and instead try to understand the hint given.

in reply to:  7 comment:10 by anonymous, 10 years ago

Replying to jchd18:

This is due to boolean evaluation short-circuit. Look at Help > Language Reference > Operators and read at the bottom of the page.

No bug. And please guys, don't use Trac to chat about "issues", the help forum is the suitable place for that.

I tried the same. It does not work... The first function returns true so is your argument not correct. Did anybody tried this by self??

comment:11 by anonymous, 10 years ago

In comment 1 is the evidence. Why you say this is no bug. Explain me this..

comment:12 by mLipok, 10 years ago

Place to ask and learn is here:
https://www.autoitscript.com/forum/

comment:13 by anonymous, 9 years ago

I spent a long time debugging my script and tearing my hair out before uncovering this ticket. Please at least update the documentation to reflect that there can only be 1 FileInstall per line.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.