In DRAKON-AutoHotkey ( http://ahkscript.org/boards/viewtopic.php?f=6&t=3108 ) I cant use functions everywhere because in AutoHotkey not everything can be included in functions. I prefer to use code generation from diagram within function wherever it is possible. But when there is a code that can't be inside function I need to use Free type diagram, which allows code generation within label and return (Gosub), or within label and another goto (Goto). When you are calling Free type diagram with Gosub you just call diagram and it automatically return when diagram code executes(DRAKON Editor automatically generates return code at the exit of Free type diagram.). When you are calling Free type diagram with Goto then you have to manually add another Goto at the exit of the diagram and also somewhere else outside of that diagram label for that Goto. So, for Free type diagram, Gosub method for calling Free type diagram is much more convenient then Goto method. Gosub is perfectly suited for Free type diagrams. Please dont remove Gosub and Goto. They both are need for DRAKON-AutoHotkey to working properly.fincs wrote:Why can't you use functions with assume-global mode instead of subroutines? Also, nobody said anything about removing Goto (and in fact I also oppose its removal).
Assorted & Unsorted AutoHotkey v2 Wish List
Re: Assorted & Unsorted AutoHotkey v2 Wish List
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
Re: Assorted & Unsorted AutoHotkey v2 Wish List
lexikos wrote:Except for subroutines in functions...fincs wrote:since all functionality that formerly used subroutines has been reworked to use functions,
I think the concepts are pretty much the same for parameterless functions, just the syntax is different.toralf wrote:I think it is on of the simple concepts that makes AHK so attractive for beginners.
Re: Assorted & Unsorted AutoHotkey v2 Wish List
It is far better to teach the user how to correctly use functions.kon wrote:But instead of eliminating the command, I think it is better to advise new users to use goto instead.
Re: Assorted & Unsorted AutoHotkey v2 Wish List
For reference:
Docs wrote:Although Gosub is useful for simple, general purpose subroutines, consider using functions for more complex purposes.
Docs wrote:The use of Goto is discouraged because it generally makes scripts less readable and harder to maintain.
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Assorted & Unsorted AutoHotkey v2 Wish List
lexikos
So, as I understand Gosub and Goto will not be removed in v2, right?
So, as I understand Gosub and Goto will not be removed in v2, right?
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
Re: Assorted & Unsorted AutoHotkey v2 Wish List
gosub and goto are still both useful especially with the way v2 handles local labels (you can use the same label names as long they are within different function scopes, no need to come up w/ unique label[for local labels only] names.). I use them to implement some sort of pseudo-closure.
Re: Assorted & Unsorted AutoHotkey v2 Wish List
Cool! Didn't know
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Return to “AutoHotkey Development”
Who is online
Users browsing this forum: No registered users and 49 guests