<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Class Delete]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15333</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15333&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Class Delete».]]></description>
		<lastBuildDate>Sat, 02 May 2020 13:00:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139280#p139280</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Сохранил результаты ObjBindMethod в обычный массив.</p></blockquote></div><p>С этим тоже возникли неудобства и глюки.<br />Так вроде всё норм.<br />Непонятно конечно почему ObjBindMethod так работает, и им нельзя нормально воспользоваться.<br /></p><div class="codebox"><pre><code>
ex := new class1() 
ex.func.Call() 
Return

class class1 { 
	__New() {   
		Class := this.__Class
		this.func := ObjBindMethod(%Class%, &quot;method&quot;, &amp;this)  
		this.param := 123
	} 
	method(hThis) {
		this := Object(hThis) 
		MsgBox % A_ThisFunc  &quot;`n&quot; this.param
	} 
	__Delete() {
		MsgBox % A_ThisFunc 
	} 
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Sat, 02 May 2020 13:00:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139280#p139280</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139271#p139271</link>
			<description><![CDATA[<p>Думаю как правильнее должно быть. <br />Родительский класс нужен, чтобы его имя можно было изменить только в одном месте.<br />Инкапсуляция, просто чтобы всё было в рамках одного объекта, ну и чтобы имена классов не пересеклись с другими классами или переменными.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 01 May 2020 16:41:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139271#p139271</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139269#p139269</link>
			<description><![CDATA[<p>Нет, вложенный класс ничего не знает о родительском. А зачем такой перекрёстный огонь нужен? Класс придуман, чтобы инкапсулировать какой-то функционал.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 01 May 2020 15:17:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139269#p139269</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139264#p139264</link>
			<description><![CDATA[<p>А возможно вызывать class1.method из вложенного класса не указывая имя class1?<br />Нет какой то ссылки на родительский класс?<br /></p><div class="codebox"><pre><code>
ex := new class1() 
ex.func.Call()
Return

class class1
{ 
   __New()
   {  
      this.NC := new this.NestedClass
      this.func := ObjBindMethod(this.NC, &quot;method&quot;)  
   }  
   method()
   {
      MsgBox % A_ThisFunc 
   } 
   class NestedClass {
      method()
      { 
         class1.method()
      }  
   }
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 01 May 2020 14:13:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139264#p139264</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139262#p139262</link>
			<description><![CDATA[<p>Начал править уже созданный класс, придётся переписывать прежние вызовы. </p><p>Сохранил результаты ObjBindMethod в обычный массив.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 01 May 2020 09:09:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139262#p139262</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139258#p139258</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>нужен метод class1</p></blockquote></div><p>А какая разница? Если нужно использовать при вызове метода какие-то поля из class1, можно просто передать их во встроенный класс при создании его инстанса.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 30 Apr 2020 21:57:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139258#p139258</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139257#p139257</link>
			<description><![CDATA[<p>Это понятно, но нужен метод class1. Пока сохраняю в обычном массиве.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 30 Apr 2020 21:52:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139257#p139257</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139256#p139256</link>
			<description><![CDATA[<p>Обойти можно так:<br /></p><div class="codebox"><pre><code>ex := new class1() 
ex.func.Call()
Return

class class1
{ 
   __New()
   {  
      this.NC := new this.NestedClass
      this.func := ObjBindMethod(this.NC, &quot;method&quot;)  
   } 
   __Delete()
   {
      MsgBox % A_ThisFunc 
   }
   class NestedClass {
      method()
      {
         MsgBox % A_ThisFunc 
      }  
   }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 30 Apr 2020 19:46:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139256#p139256</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139255#p139255</link>
			<description><![CDATA[<p>Опять я в справке недочитал...</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 30 Apr 2020 18:45:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139255#p139255</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139253#p139253</link>
			<description><![CDATA[<p>Кода используется связка ObjBindMethod(this, ...), возникает циркулярная ссылка на this, поэтому при освобождении ex не все ссылки на него удаляются.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 30 Apr 2020 18:15:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139253#p139253</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Class Delete]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=139251#p139251</link>
			<description><![CDATA[<p>Не понимаю почему __Delete не вызывается.<br />Если строку с ObjBindMethod(this, &quot;method&quot;) удалить или заменить на Func(&quot;method&quot;), то всё работает.<br /></p><div class="codebox"><pre><code>
ex := new class1() 
ex.func.Call()
Return

class class1
{ 
	__New()
	{  
		; this.func := Func(&quot;method&quot;)
		this.func := ObjBindMethod(this, &quot;method&quot;)  
	} 
	__Delete()
	{
		MsgBox % A_ThisFunc 
	}
	method()
	{
		MsgBox % A_ThisFunc 
	}  
}

method()
{
	MsgBox % A_ThisFunc 
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 30 Apr 2020 17:39:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=139251#p139251</guid>
		</item>
	</channel>
</rss>
