Modify

Opened 9 years ago

Closed 9 years ago

Last modified 8 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 Changed 9 years ago by anonymous

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 follow-up: Changed 9 years ago by 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

comment:3 in reply to: ↑ 2 ; follow-up: Changed 9 years ago by 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

comment:4 in reply to: ↑ 3 Changed 9 years ago by anonymous

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 follow-up: Changed 9 years ago by 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:6 in reply to: ↑ 5 Changed 9 years ago by jen

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 follow-up: Changed 9 years ago by jchd18

  • Resolution set to No Bug
  • Status changed from new to 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 Changed 9 years ago by anonymous

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

comment:9 Changed 9 years ago by jchd18

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

comment:10 in reply to: ↑ 7 Changed 9 years ago by anonymous

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 Changed 9 years ago by anonymous

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

comment:12 Changed 9 years ago by mLipok

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

comment:13 Changed 8 years ago by anonymous

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.