include v1->v2 examples in docs

Discuss the future of the AutoHotkey language
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

include v1->v2 examples in docs

19 Nov 2016, 10:37

i'm in the process of converting my major script from ahk v1 basic to ahk_H v2 . as i run into each error, i do a search through v2-changes, and then to the v2 docs to compare the differences between the v1 commands

i think it would be very useful for others making the v2 transition to have examples shown for how they could fix their code.

i don't know if these examples should be in the help pages for each command, or if they should be in the v2-changes doc. maybe the v2-changes doc could be organized better and have headings and examples for each of the changes, and that doc could become a more definitive transition guide from v1 to v2 (replacing the old Script Compatibility page). in that case the new v2-changes doc should prob get moved into the Docs repo

as an example, these could go in the SubStr help doc, or an expanded v2-changes doc

Code: Select all

;StringLeft, hello_world3, hello_world3, 5
MsgBox, % SubStr("hello_world3", 1, 5)

;StringRight, hello_world3, hello_world3, 6
MsgBox, % SubStr("hello_world3", -5)        ;// AHK v1
MsgBox, % SubStr("hello_world3", -6)        ;// AHK v2

;StringTrimLeft, hello_world3, hello_world3, 6
MsgBox, % SubStr("hello_world3", 7)

;StringTrimRight, hello_world3, hello_world3, 7
MsgBox, % SubStr("hello_world3", 1, -7)

lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: include v1->v2 examples in docs

19 Nov 2016, 17:38

I think we should update the examples and scripts that are already in the docs first. ;)

I do not plan to work on either any time soon.

v2-changes is intended as a changelog of sorts. I will not add examples to it, but anyone is free to write new documentation, based on v2-changes or not.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: include v1->v2 examples in docs

19 Nov 2016, 19:12

lexikos wrote:I think we should update the examples and scripts that are already in the docs first. ;)
all of the commands that i can remember that i looked up in the v2 docs, the examples had already been changed to reflect the changes in v2. but yeah if there are others that aren't, that is probably a good place to start
lexikos wrote:but anyone is free to write new documentation, based on v2-changes or not.
8-)


Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 44 guests