<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: MaxIndex объекта в классе]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12897&amp;type=atom" />
	<updated>2017-08-10T09:26:25Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12897</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: MaxIndex объекта в классе]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118053#p118053" />
			<content type="html"><![CDATA[<p>Не знаю в чем была проблема. Но теперь всё нормально. Видимо звёзды шалят. Закрывайте.</p>]]></content>
			<author>
				<name><![CDATA[alekksss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33684</uri>
			</author>
			<updated>2017-08-10T09:26:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118053#p118053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: MaxIndex объекта в классе]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118049#p118049" />
			<content type="html"><![CDATA[<p>Столкнулся с проблемой такого типа:<br /></p><div class="codebox"><pre><code>class Class
{
	test := Object()
}
cl := new Class
cl.test[1] := 1
cl.test[2] := 2
msgbox, % cl.test.MaxIndex()</code></pre></div><p>MaxIndex() ничего не возвращает. Как решается?<br />Поправка - тут всё работает! Но у меня в классе она ничего не возвращает!<br />Мой класс:</p><div class="codebox"><pre><code>Class Key
{
	Text := Object()
	FullText := Object()
	IsEnter := Object()
	Bind := Object()
	KeyID := Object()
	Profile := Object()
	MaxKeys := Object()
	Load(lProfile)
	{
		global
		FileRead, File, %binderDir%\%lProfile%.bind
		FileObj := StrSplit(File, &quot;------------&quot;, &quot;`r&quot;)
		Max := FileObj.MaxIndex()
		This.MaxKeys[lProfile] := 0
		loop %Max%
		{
			bRead := Trim(FileObj[A_Index], &quot;`r`n&quot;)
			if(!RegExMatch(bRead, &quot;ms)\:\:ID\:(\d+)\:\:Key\:(.*)\:\:$(.*)\:\:return\:\:&quot;, ret))
				continue
			ret3 := Trim(ret3, &quot;`r`n&quot;)
			if(This.KeyID.HasKey(&quot;Key:&quot; ret2))
				continue
			This.Text[&quot;Key:&quot; ret2] := StrSplit(ret3, &quot;`n&quot;, &quot;`r&quot;)
			This.FullText[&quot;Key:&quot; ret2] := ret3
			This.Profile[&quot;Key:&quot; ret2] := lProfile
			This.KeyID[&quot;Key:&quot; ret2] := ret1
			This.Bind[&quot;ID:&quot; ret1] := ret2
			This.MaxKeys[lProfile]++
		}
	}
	Add()
	{
	}
	Delete()
	{
	}
	Get()
	{
	}
}
global Key := new Key</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alekksss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33684</uri>
			</author>
			<updated>2017-08-10T09:02:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118049#p118049</id>
		</entry>
</feed>
