Jump to content

FileInstall not working expectly


Recommended Posts

  • Moderators

stamplin,

Quote

 I am sure nobody of you tried what I wrote in #14

I did - and I get the same result as you. But the difference in behaviour between the version run from SciTE and after compilation is easily explained by this line taken from the Help file:

Quote

When this function is used from a non-compiled script, a copy operation is performed instead (to allow for easy testing pre-compilation).

So when run from SciTE you just copy the files and all works as you expect. When compiled the code will use the "proper" FileInstall code to create the files and that appears (as you have correctly pointed out) to ignore a subsequent FileInstall on the same line. If you find this a serious problem I suggest you open a BugTracker ticket (look in the menu at the top of the page) so that it can be looked at during the next development period.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Thank you, thank you, thank you, that you really tried it.

I think it is not that important but it is strange for me. It is used as a normal function so why I can not use so many functions as I want in the same line.
Many people did not understand this. Only that was my problem. If it is not possible because of the design or something else there should only be a little hint in the documentation to prevent threads like this.

Link to comment
Share on other sites

  • Developers

You are correct there some strange behavior with that. try added a 1 for parameter 3  in FileInstall() and it probably will work.

Fact remains that you shouldn't be doing it this way whatever you say, so simply split it up into 2 separate fileinstall's to ensure they are both performed.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
2 hours ago, Melba23 said:

If you find this a serious problem I suggest you open a BugTracker ticket

Please don't as there were already a couple as I indicated earlier in this thread. Even though there is something strange happening, I don't see any reason spending time on it as there is a flaw in that approach.

2 hours ago, stamplin said:

Many people did not understand this.

I've understood you from the very first post but I am wondering if you understood me when I posted the example that the approach is fundementally wrong?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

13 minutes ago, Jos said:

I've understood you from the very first post but I am wondering if you understood me when I posted the example that the approach is fundementally wrong?

Yes, fundementally it is wrong and a very bad style to code like that you are right. It was important for me to show there is something strange with this function.

Link to comment
Share on other sites

  • Developers
4 hours ago, stamplin said:

One more I have to say:

$res = FileInstall("a.txt", "a2.txt") + FileInstall("b.txt", "b2.txt")

 

executed as not compiled version:   value of $res = 2

executed as compiled version:           value of $res = 1

 

Just try it, please try it. This is not normal, but nobody believe me.
Now you can close it I said my part.

What do you get in the log when you run this script from SciTE and compiled :

FileDelete("log.txt")
;
FileDelete("a.txt")
FileDelete("b.txt")
FileWrite("a.txt","test a")
FileWrite("b.txt","test b")
FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt") + FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res ) ;### Debug Console

FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt")
$res += FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res)

I get this for both:

$res = 2
$res = 2

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

mmm but this gives 1 

FileDelete("log.txt")
;
FileDelete("a.txt")
FileDelete("b.txt")
FileWrite("a.txt", "test a")
FileWrite("b.txt", "test b")


FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt") + FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res ) ;### Debug Console

Guess we can conclude that you shouldn't put it on one line. :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

1 hour ago, Jos said:

What do you get in the log when you run this script from SciTE and compiled :

FileDelete("log.txt")
;
FileDelete("a.txt")
FileDelete("b.txt")
FileWrite("a.txt","test a")
FileWrite("b.txt","test b")
FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt") + FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res ) ;### Debug Console

FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt")
$res += FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res)

I get this for both:

$res = 2
$res = 2

Jos

The same here.

 

1 hour ago, Jos said:

mmm but this gives 1 

FileDelete("log.txt")
;
FileDelete("a.txt")
FileDelete("b.txt")
FileWrite("a.txt", "test a")
FileWrite("b.txt", "test b")


FileDelete("a2.txt")
FileDelete("b2.txt")
$res = FileInstall("a.txt", "a2.txt") + FileInstall("b.txt", "b2.txt")
FileWriteline("log.txt",'$res = ' & $res ) ;### Debug Console

Guess we can conclude that you shouldn't put it on one line. :)

Jos

And the same here, too. :D

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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