Nested classes

Get help with using AutoHotkey 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”

Who is online

Users browsing this forum: assak123, n1ce0n3, SilasDeVis, triven and 110 guests