func err

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

func err

Post by arcticir » 11 Feb 2020, 12:58

Code: Select all

MsgBox % a()

f:=flux()

Code: Select all

Error:  Call to nonexistent function.

Specifically: a())

	Line#
--->	001: MsgBox(a())
	003: f := flux()

Code: Select all

flux(){   ;to lib file

}

a(){

}
User avatar
boiler
Posts: 17097
Joined: 21 Dec 2014, 02:44

Re: func err

Post by boiler » 11 Feb 2020, 16:42

Since you don't have a file named a.ahk in your library, it doesn't know where to find that function until it actually does find flux.ahk in your library, which then causes a() to be included in your script. If you had called flux() first, then you wouldn't get an error:

Code: Select all

f:=flux()
MsgBox % a()
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: func err

Post by arcticir » 11 Feb 2020, 18:23

Thank you. It seems that good naming conventions are very important.
Post Reply

Return to “Ask for Help (v1)”