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

Report problems with documented functionality
SAbboushi
Posts: 252
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: 3463
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


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 27 guests