AHK V2, "fn := Func(fn)": Is doc correct or am I missing something?

Discuss the future of the AutoHotkey language
SAbboushi
Posts: 136
Joined: 08 Dec 2014, 22:13

AHK V2, "fn := Func(fn)": Is doc correct or am I missing something?

13 Jul 2018, 12:20

https://lexikos.github.io/v2/docs/objects/Func.htm
If fn is a function reference, Func(fn) returns it. Thus, fn := Func(fn) can be used to ensure fn is a function reference. If fn is neither a valid function name nor a function reference, Func returns a blank value.

Code: Select all

; Retrieve a reference to the function named "StrLen".
fn := Func("StrLen")
fn := Func(fn)
Error:
Error: Parameter #1 invalid.

Line#
002: fn := Func("StrLen")
---> 003: fn := Func(fn)
004: Exit
005: Exit
005: Exit

The current thread will exit.
guest3456
Posts: 2433
Joined: 09 Oct 2013, 10:31

Re: AHK V2, "fn := Func(fn)": Is doc correct or am I missing something?

13 Jul 2018, 13:15

looks like that docs page wasn't updated.

from the Func() page, it now specifically requires a string:
https://lexikos.github.io/v2/docs/commands/Func.htm

and a90 changelog:
https://autohotkey.com/boards/viewtopic ... 22#p208322

lexikos
Posts: 6201
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: AHK V2, "fn := Func(fn)": Is doc correct or am I missing something?

13 Jul 2018, 19:46

guest is correct. I have now updated objects/Func.

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 5 guests