AHK v1 to AHK v2 conversion tips/changes summary

Discuss the future of the AutoHotkey language
User avatar
jeeswg
Posts: 2199
Joined: 19 Dec 2016, 01:58
Location: UK

AHK v1 to AHK v2 conversion tips/changes summary

07 Sep 2017, 22:13

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by jeeswg on 10 Sep 2017, 07:59, edited 5 times in total.
User avatar
jNizM
Posts: 2273
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: AHK v1 to AHK v2 conversion tips/changes summary

08 Sep 2017, 00:57

Why do you post the half stuff from here (https://autohotkey.com/v2/) into here... even if v2 is not finished at all :think:
Next question.. why do you open mutliple threads about v1 to v2 conversion / changes? :think:

Also I dont see a reason why people should care v2 changes, if it's not finshed and there is not a stable build
The current alpha release is usable, but some features, behaviour or syntax may be altered in the next release or future releases.
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
jeeswg
Posts: 2199
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AHK v1 to AHK v2 conversion tips/changes summary

08 Sep 2017, 02:53

People asked me for a summary of what would be involved in converting to AHK v2. I wanted one easy-to-find thread. And further to that, this is basically the post I would have wanted when I wanted to know what would be involved in AHK conversion.

There's a difference between understanding what's involved, and writing a script that automates parts of it (most of it) for you. Hence separate threads.

Well it's interesting, there seem to be two distinct camps. Why ARE you using AHK v2 already? Why AREN'T you using AHK v2 already? Perhaps we can find some people of the contrary opinion and get a little argument going. I'm somewhere in the middle.

My opinion is that AHK v2 was complete enough when I started investigating it, to make it worthwhile to begin work on conversion scripts and understanding the changes. Furthermore I was working on AHK v1 function versions of AHK v1 commands, but it appeared wise to modify this slightly to make it AHK v1 function versions of AHK v2 functions.

Fundamentally though, if you know what the changes will be, you can write your AHK v1 scripts in a way that will make them easier to convert later. This is really important, and a big motivation for the guide above.

One thing that I've done which is quite important, is to distinguish between conversion relating to AHK v1 deprecated practices to AHK v1 preferred practices, as opposed to the pure AHK v1 to AHK v2 conversion. Most of the hard-to-convert stuff is actually moving from deprecated AHK v1 practices to newer AHK v1 practices.
just me
Posts: 4685
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: AHK v1 to AHK v2 conversion tips/changes summary

08 Sep 2017, 03:08

:arrow: Changes from v1.1 to v2.0
Do you think your version is better?
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
jeeswg
Posts: 2199
Joined: 19 Dec 2016, 01:58
Location: UK

Re: AHK v1 to AHK v2 conversion tips/changes summary

08 Sep 2017, 03:40

It wasn't my intention to produce something 'better' than that webpage.

Is there a way to check when it was updated? Obviously being more up-to-date can be an advantage.

I have various bits of information that aren't there. Also there is the emphasis on pointing out AHK v1 good/bad practices, and how *that* is actually the harder part of converting. There is a focus on what you need to do to convert, versus what is the nature of AHK v1 versus v2. Sometimes shorter is better, more focused/prioritised, easier to reread, sometimes longer is better, more detail, more complete. It is a great link, I learnt the core, maybe 80% or more, of what I needed to know about conversion from there. And I did mention it in my guide.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests