#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 , 11 years ago
follow-up: 3 comment:2 by , 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
follow-up: 4 comment:3 by , 11 years ago
comment:4 by , 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..
follow-up: 6 comment:5 by , 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.
comment:6 by , 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.
follow-up: 10 comment:7 by , 11 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
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 , 10 years ago
Sorry but you did not try it, right? This is a bug.. See the evidence.. It has to work..
comment:10 by , 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 , 10 years ago
In comment 1 is the evidence. Why you say this is no bug. Explain me this..
comment:13 by , 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.

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") ExitVersion 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!