Nested classes

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
expert_vision
Posts: 21
Joined: 13 Jan 2014, 10:47

Nested classes

23 Apr 2014, 18:18

Why is the constructor of the "Element" nested class not called ?

Code: Select all

obj := new List()
obj.AddElement(13)

class List
{
	AddElement(index)
	{
		this.Insert(new Element(index))
	}
	
	class Element
	{
		__New(index)
		{
			this.Index := index
			MsgBox works
		}
	}
}
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: Nested classes

23 Apr 2014, 18:54

Perhaps try this.Insert(new this.Element(index))

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Marium0505 and 350 guests