Is this the expected behavior of Reload?

Report problems with documented functionality
spawn
Posts: 4
Joined: 31 Mar 2021, 06:17

Is this the expected behavior of Reload?

27 Apr 2022, 04:58

Have been using AutoHotKey for probably over ten years and this is one of those issues that have been around ... but found ways around them.

Recently, I came across a few more issues and thought I'll ask the ones that are "important enough". :D

If an AHK script has multiple instances with GUIs open, reloading script will reload the most recently opened GUI and not the one where the reload took place.

The following simple script demonstrates what I mean. Run the script a few times.

Code: Select all

#SingleInstance, off

Gui, Add, Button,, Reload
Gui, Show, w200, 
Return

ButtonReload:
Reload

instead of using Reload, the simplest solution that I found is:

Code: Select all

Run % A_ScriptFullPath
ExitApp
But shouldn't Reload actually reload the last GUI instance?
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Is this the expected behavior of Reload?

27 Apr 2022, 22:01

Yes.

Reload just runs the script with the /restart switch, and if the new instance contains no errors, it closes the old one. It is implied by the wording in the documentation that the possibility of multiple instances was not taken into account, and the old instances are identified by title, which is the same for all.

I considered changing it for v2, but didn't due to doubts about how it should work and just generally not finding it to be a problem.
joefiesta
Posts: 502
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Is this the expected behavior of Reload?

29 Apr 2022, 09:27

@Lexicos - I think, then, that this should be treated as a documentation issue. This should be more succintly stately. One should not have to make inferences from what may be a subtle implication.

Of course, the problem I have with documentation issues is that most of my suggestions--all of which I believe are reasonable and good--are simply ignored. The means of making documentation improvement suggestions has always been less than good.
User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: Is this the expected behavior of Reload?

29 Apr 2022, 09:58

@Lexicos might want to pass along that thought to @lexikos. ;)
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Is this the expected behavior of Reload?

29 Apr 2022, 22:39

If I leave a topic in Bug Reports after posting, it is usually because I think something will need to be done about it (or I have doubts about how to classify it). I intend to address it in my own time, when I am not focused on other sub-projects.

@joefiesta If merely posting suggestions isn't effective, perhaps you should do something else. I shouldn't need to explain that it is no one's job or duty to implement your suggestions, or to explain to you why they are not doing so right now, or even respond. Personally I tend to avoid reading your posts, and usually avoid replying to those which I read, because the tone and complaints antagonize me and aren't conducive to a productive time. If at some point in the future I choose to spend my free time improving the quality of the documentation instead of doing something that I actually enjoy, I will refer to posts in the Suggestions forum, including yours. Anyone who cares enough about improving AutoHotkey before then may find a more direct method of contributing.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 23 guests