Return or not — that is the question Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Return or not — that is the question  Topic is solved

Post by StefOnSteroids » 07 Mar 2023, 04:38

From what I gathered, "return" is not used anymore to terminate a hotkey or function call. But I also have areas in my code, that are not bound by braces {}. Do I still need "return" after those lines?

Case in question: I build groups (AddGroup) and menus at the top of my script. Should I end this section with "return" as in v1 or not?

neogna2
Posts: 598
Joined: 15 Sep 2016, 15:44

Re: Return or not — that is the question

Post by neogna2 » 07 Mar 2023, 05:08

Inside functions you don't need to put a return unless you want to return something return ThisVar

As for the auto-execute section (top of the script) see this previous thread viewtopic.php?f=82&t=114719


StefOnSteroids
Posts: 77
Joined: 08 Aug 2015, 10:22

Re: Return or not — that is the question

Post by StefOnSteroids » 07 Mar 2023, 05:33

Thank you, both. I hope I got it now.
I will not put an insert after building my groups and menus.

Post Reply

Return to “Ask for Help (v2)”