Is "callback" a restricted word?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Relayer
Posts: 160
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Is "callback" a restricted word?

12 Jan 2017, 18:06

Hi,

I noticed if I name a method in a class object 'callback()' that it will not run when invoked but it will run if I change it to 'setCallback()'. I couldn't find in the documentation a set of restricted names for variables/functions besides the obvious ones that are built in. I don't suppose there is a list of these somewhere so they can be avoided? Troubleshooting this can be a bugger.

Relayer
User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Is "callback" a restricted word?

12 Jan 2017, 18:50

It works for me.

Code: Select all

name.callback()

class name {
	callback(){
		MsgBox, Hey
	}
}
Please excuse my spelling I am dyslexic.
User avatar
Relayer
Posts: 160
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: Is "callback" a restricted word?

12 Jan 2017, 20:57

Never mind... silly me, I had a class variable named the same thing. I make that mistake a lot. I mistakenly give a method the same name as a variable in the class and it chokes.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 165 guests