<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Максимальное количество букв в слове]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9075&amp;type=atom" />
	<updated>2013-12-25T15:47:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9075</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78512#p78512" />
			<content type="html"><![CDATA[<p>Текст делится на слова и в цикле проверятся длина очередного слова. (сравниваем с числом в переменной MaxLen)<br />Если она больше, чем у ранее найденного &quot;гиганта&quot;, то MaxLen присваивается новое значение, а слово сохраняется в Result.</p><p>Upd:<br /><strong>ypppu</strong> верно заметил, если это важно, можно предусмотреть ситуацию, когда несколько слов имеют одинаковую длину.<br /></p><div class="codebox"><pre><code>MaxLen := 0
Text =
(
aaa bb cc ddd
zzz
)

Text := RegExReplace(Text, &quot;[^a-zA-Zа-яА-Я\s]&quot;)
Loop, Parse, Text, %A_Space%`n
   if ((CurrLen := StrLen(A_LoopField)) = MaxLen) {
      Result .= A_LoopField &quot;`n&quot;
       Continue
   }
   else if (CurrLen &gt; MaxLen) {
      MaxLen := CurrLen
      Result := % A_LoopField &quot;`n&quot;
   }
MsgBox % &quot;Слово (слова):`n&quot; Result &quot;`nКол-во знаков - &quot; MaxLen</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2013-12-25T15:47:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78512#p78512</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78509#p78509" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Irbis пишет:</cite><blockquote><div class="codebox"><pre><code>

   if (StrLen(A_LoopField) &gt; MaxLen) 
{
      MaxLen := StrLen(A_LoopField)
      Result := % A_LoopField
   }
</code></pre></div></blockquote></div><p>Объясните эти строчки пожалуйста. Вникнуть не могу</p>]]></content>
			<author>
				<name><![CDATA[Qweasd123]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31279</uri>
			</author>
			<updated>2013-12-25T14:14:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78509#p78509</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78506#p78506" />
			<content type="html"><![CDATA[<p>Благодарю!</p>]]></content>
			<author>
				<name><![CDATA[Qweasd123]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31279</uri>
			</author>
			<updated>2013-12-25T14:09:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78506#p78506</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78505#p78505" />
			<content type="html"><![CDATA[<p>Кстати, может быть несколько слов с максимальным количеством букв?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2013-12-25T14:09:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78505#p78505</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78504#p78504" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>MaxLen :=0
Text =
(
Не жалею, не зову, не плачу,
Все пройдет, как с белых яблонь дым.
Увяданья золотом охваченный,
Я не буду больше молодым.
)

Text := RegExReplace(Text, &quot;[^a-zA-Zа-яА-Я\s]&quot;)
Loop, Parse, Text, %A_Space%`n
   if (StrLen(A_LoopField) &gt; MaxLen) {
      MaxLen := StrLen(A_LoopField)
      Result := % A_LoopField
   }
MsgBox % &quot;Слово: &quot; . Result . &quot; `; Кол-во знаков - &quot; . MaxLen
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2013-12-25T14:05:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78504#p78504</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78503#p78503" />
			<content type="html"><![CDATA[<p>Но как именно по словам сканировать а не сразу полностью предложение? Не получается.</p>]]></content>
			<author>
				<name><![CDATA[Qweasd123]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31279</uri>
			</author>
			<updated>2013-12-25T13:57:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78503#p78503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78502#p78502" />
			<content type="html"><![CDATA[<p><span class="bbu">Loop (parse a string)</span><br />Loop, Parse, InputVar [, Delimiters, OmitChars] </p><br /><p><span class="bbu">StringLen</span><br />StringLen, OutputVar, InputVar</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2013-12-25T13:45:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78502#p78502</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Максимальное количество букв в слове]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=78501#p78501" />
			<content type="html"><![CDATA[<p>Дан текст. Как найти слово с максимальным количеством букв?</p>]]></content>
			<author>
				<name><![CDATA[Qweasd123]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31279</uri>
			</author>
			<updated>2013-12-25T12:42:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=78501#p78501</id>
		</entry>
</feed>
