Modify

#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, on Aug 18, 2015 at 7:10:27 PM

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, on Aug 18, 2015 at 7:15:23 PM

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, on Aug 18, 2015 at 11:17:18 PM

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, on Aug 19, 2015 at 10:44:31 AM

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, on Sep 2, 2015 at 4:20:31 AM

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, on Sep 2, 2015 at 8:33:33 AM

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, on Sep 2, 2015 at 10:49:25 AM

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, on Sep 17, 2015 at 8:29:36 AM

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

comment:9 by jchd18, on Sep 17, 2015 at 9:33:24 PM

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

in reply to:  7 comment:10 by anonymous, on Dec 9, 2015 at 9:29:49 AM

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, on Dec 9, 2015 at 9:34:06 AM

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

comment:13 by anonymous, on Mar 7, 2017 at 1:59:49 PM

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.