I can’t tell you the # of times AutoHotkey Variadic Functions come in handy

AutoHotkey Variadic FunctionsAutoHotkey Variadic Functions can be incredibly handy when you don’t know the exact number of parameters.   The below example shows some simple math where you can pass any number of parameters to be added.  It also demonstrates how you can use MaxIndex() to determine how many parameters were passed to the function.

Demonstration using AutoHotkey Variadic Functions

How to create and use variadic functions in AutoHotkey

Use ByRef to Return Multiple Values from AutoHotkey Functions via

Return Multiple Values from AutoHotkey FunctionsIn my initial video I talked through how & why to use AutoHotkey functions as well as how to return one value from a function.  This video will demonstrate how to Return Multiple Values from AutoHotkey Functions via the byRef command.  You can also return multiple values by returning an Object or an Array which can hold any-number of values..  The byRef command can seem a bit tricky at first, but it really is an easy way to return many values from a function. My next video will cover using the Include command

Return multiple values from AutoHotkey functions with byRef

returning values from an AutoHotkey function with byref

Intro tutorial on using AutoHotkey functions to streamline code

AutoHotkey functionAutoHotkey functions are a true gem that help streamline your code, make it more readable, easier to maintain, and avoid conflicts with other variables (because their scope is local by default.  They take a little practice getting used to however they can save a ton of time and allow for re-using a ton of code.   Don’t get hung-up on writing them at the beginning of your script.  Often I go back after writing my script and realize I should have written a function in place of a subroutine.

My first video on AutoHotkey functions explains why & how you can use them.

Intro to AutoHotkey functions-Great ways to streamline your code!