<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Работа с классами. __Get Подкласса.]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10878&amp;type=atom" />
	<updated>2015-08-18T13:54:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10878</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с классами. __Get Подкласса.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=96577#p96577" />
			<content type="html"><![CDATA[<p>Спасибо.</p><p>Нужно для того что бы вызывать как бы функцию у которой не надо указывать параметры.<br /></p><div class="codebox"><pre><code>Var := new MyClass

Var.ChildVar.A
Var.ChildVar.B
Var.ChildVar.C

class MyClass
{
    __New()
    {
        this.ChildVar := new this.ChildVar
    }

    Class ChildVar
    {
        __Get(var)
        {
            if var = A
                msgbox Действие 1
            if var = B
                msgbox Действие 2
            if var = C
                msgbox Действие 3
        }
    
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-08-18T13:54:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=96577#p96577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Работа с классами. __Get Подкласса.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=96573#p96573" />
			<content type="html"><![CDATA[<p>А зачем вообще этот Get вам нужен?<br /></p><div class="codebox"><pre><code>A := new abc
A.d
A.sub.C

class abc
{
    __New()  {
        this.sub := new this.B
    }
; Get B
    __Get(var)
    {
        if var in d,e,f
            msgbox % var
    }

; Get C
    Class B
    {
        __Get(var)
        {
            msgbox % var
        }
    
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-08-18T12:58:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=96573#p96573</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Работа с классами. __Get Подкласса.]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=96569#p96569" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>class abc
{
; Get B
    __Get(var)
    {
        msgbox % var
    }

; Get C
    Class B
    {
        __Get(var)
        {
            msgbox % var
        }
    
    }
}

A := new abc
A.B.C</code></pre></div><p>Как получить имя C, с B это просто, но с C не работает.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-08-18T11:02:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=96569#p96569</id>
		</entry>
</feed>
