change from v1 to v2 - is it possible to get a whole list of all errors?

Discuss the future of the AutoHotkey language
User avatar
Taurus
Posts: 89
Joined: 20 Jan 2015, 10:31

change from v1 to v2 - is it possible to get a whole list of all errors?

23 Oct 2020, 05:39

Hi,

I am starting to change my >10.000 lines scripts from v1 to v2. Is it possible to get a whole list of all errors?

At the moment i click on debug and get 1 error after another. But i can't change the "..., % var . var", because it will break v1 and i still have to dev on.

I am using https://www.autohotkey.com/boards/viewtopic.php?f=37&t=29689&p=210818#p210818 to get the switch easier.

Any idea/help? ;)
:beard: Full Stack Developer > Dev for a better world | PHP for Web | AHK H for Local | with KISS (Keep IT Short and Simple) on Win 10 Pro (Version 2004) x64
guest3456
Posts: 3153
Joined: 09 Oct 2013, 10:31

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

23 Oct 2020, 06:01

you can try this, its old and definitely not up to date, but can maybe save some time:

https://www.autohotkey.com/boards/viewtopic.php?t=25100

actually i think that converter still uses the old command syntax, and now in v2 its all functions just without the parens() and so all params are expression params. who knows i forget what v2 does anymore
Taurus wrote:
23 Oct 2020, 05:39
Any idea/help? ;)
otherwise, only other idea i have is to just stick with v1. i'm not sure v2 will ever be officially released and its just not worth the headache if you have a big script with ongoing maintenance, because you could devote weeks to converting to v2 right now, and then next month everything breaks again when v2 changes again

SOTE
Posts: 1195
Joined: 15 Jun 2015, 06:21

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

23 Oct 2020, 06:33

Taurus wrote:
23 Oct 2020, 05:39
I am starting to change my >10.000 lines scripts from v1 to v2.
But why would you want to convert such a long script from v1 to v2 to begin with? Seems like it would be more trouble than it's worth. If the script is running fine as v1, then arguably better to leave it be. If you are so interested in v2, then perhaps you write new scripts with it, versus converting very long v1 scripts. Also, as mentioned by guest3456, v2 is still alpha and experimental. Writing anything in v2 outside of experimental use, can cause massive problems. A person shouldn't be using v2 for any serious scripts that must be relied upon for work or their business.
swagfag
Posts: 4092
Joined: 11 Jan 2017, 17:59

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

09 Nov 2020, 04:09

it will break v1 and i still have to dev on.
probably unfeasible. possibly feasible if u very carefully modularize/rewrite ur app to only use classes with basic functionality(ie no v1-specific metafunctions/class hierarchy type stuff)
at the end of the day ud still have to change all gui parts/hotkeys in one fell swoop, so i dont know if its even worth trying
User avatar
nnnik
Posts: 4480
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

13 Nov 2020, 07:22

If there was a variable %A_AhkMajorVersion% or similar like I suggested and made pull requests for you could include different libraries depending on your version.
This would possibly allow the community to create gui libraries that work independently from a version number.
However lexikos seems to prefer alternative ideas.
Recommends AHK Studio
User avatar
Tigerlily
Posts: 359
Joined: 04 Oct 2018, 22:31

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

16 Nov 2020, 16:32

@Taurus

I did this with a pretty large script about the same size as yours. It wasn't an insanely complex script, but still had a lot of things that needed to be completely switched to v2 and wasn't basic. It would have been nice to have what you are talking about, however I just went one line at a time fixing each error as I switched it.

Sometimes this will send you down a giant rabbit hole of errors that actually need to have one thing changed not related to the error itself. After doing this successfully and porting the entire script, It helped me understand how to port scripts better from v1 to v2, which is really what you need to understand instead of having every error be read out.

Read everything here and here and it these resources will help you debug much easier and have a more seamless porting experience.
-TL
User avatar
hyaray
Posts: 34
Joined: 20 Jun 2015, 01:37

Re: change from v1 to v2 - is it possible to get a whole list of all errors?

28 Dec 2020, 19:12

My script may be even bigger, I also want to convert, I'm using v2 a102,
especially after v104, the syntax has changed a lot.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 3 guests