https://www.oreilly.com/library/view/vbscript-in-a/0596004885/re109.html
https://www.autohotkey.com/docs/v1/lib/Func.htm
; #FUNCTION# =============================================================================
; Name ..........: __GetRef
; Syntax ........: __GetRef($o_FunName = '', Const $p1 = Default, Const $p2 = Default, Const $p3 = Default, Const $p4 = Default, _
; Const $p5 = Default, Const $p6 = Default)
; Parameters ....: $o_FunName - Callbacks Function Name
; $p1 - [optional]
; $p2 - [optional]
; $p3 - [optional]
; $p4 - [optional]
; $p5 - [optional]
; $p6 - [optional]
; Return values .: Object
; Author ........: jugador
; ========================================================================================
Example 1
Example 2
Example 3
Example 4
Example 5
#include "GetRef UDF2.au3"
__ExampleA()
Func __ExampleA()
Local $TestB = __GetRef('MsgFunction', 'PrintMsg')
$TestB()
EndFunc
Func PrintMsg($friend)
ConsoleWrite(2 & @crlf)
ConsoleWrite("How " & $friend & @crlf)
ConsoleWrite(3 & @crlf)
EndFunc
Func MsgFunction($myFunc)
ConsoleWrite(1 & @crlf)
Call($myFunc, "are You?")
ConsoleWrite(4 & @crlf)
EndFunc
Example 5 output:
1
2
How are You?
3
4
GetRef UDF:
GetRef UDF2.au3
GetRef UDF3.au3