<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159519</guid>
        <pubDate>Fri, 22 Jun 2012 22:55:09 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159519</link>
        <description><![CDATA[northener: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=359596&view=findpost&p=3159316'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pcrepair &#064; <time class="tag-quote__quoted-time" datetime="2012-06-22T17:44:47+04:00">22.06.12, 13:44</time></span><div class='quote '>так это правильная привычка?</div></div><br>
Это просто привычка.<br>
И к тому же в интернете очень много примеров созданных очень давно. И некоторые примеры годятся и в старых и новых версиях, а некоторые только в старых.]]></description>
        <author>northener</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159316</guid>
        <pubDate>Fri, 22 Jun 2012 13:44:47 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159316</link>
        <description><![CDATA[Pcrepair: так это правильная привычка?<br>
а то тут пишут:<br>
If a class has a default property, you can access that property with the abbreviation object[index], which is equivalent to object.property[index]. For example, given the declaration above, StringArray.Strings[7] can be abbreviated to StringArray[7]. A class can have only one default property with a given signature (array parameter list), but it is possible to overload the default property. Changing or hiding the default property in descendent classes may lead to unexpected behavior, since the compiler always binds to properties statically. <br>
<br>
Если класс имеет свойство по умолчанию, вы можете получить доступ к этой свойствам с сокращением объекта [индекс], что эквивалентно object.property [индекс]. Например, если объявление выше, StringArray.Strings [7] может быть сокращено до StringArray [7].Класс может иметь только одно свойство по умолчанию с заданной подписью (список параметра-массива), но это возможно перегружать свойство по умолчанию. Изменение или скрывать свойства по умолчанию в потомком класса может привести к неожиданному поведению, так как компилятор всегда привязывается к свойствам статически.]]></description>
        <author>Pcrepair</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159244</guid>
        <pubDate>Fri, 22 Jun 2012 12:58:05 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159244</link>
        <description><![CDATA[northener: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=359596&view=findpost&p=3159191'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pcrepair &#064; <time class="tag-quote__quoted-time" datetime="2012-06-22T12:03:51+00:00">22.06.12, 12:03</time></span><div class='quote '>еще некоторые пишут: aDest.Add(aSrc.Strings[I]); результат один и тот же, какой смысл в усложнении? </div></div><br>
Привычка со времен ранних версий Дельфи.]]></description>
        <author>northener</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159191</guid>
        <pubDate>Fri, 22 Jun 2012 12:03:51 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3159191</link>
        <description><![CDATA[Pcrepair: Profi, спасибо и два маленьких вопроса:<br>
aDest.Add(&#39;aSrc[I]&#39;); - это что специально? ну ковычки?<br>
еще некоторые пишут: aDest.Add(aSrc.Strings[I]); результат один и тот же, какой смысл в усложнении?]]></description>
        <author>Pcrepair</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158926</guid>
        <pubDate>Fri, 22 Jun 2012 06:24:57 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158926</link>
        <description><![CDATA[VahaC: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=359596&view=findpost&p=3158841'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pcrepair &#064; <time class="tag-quote__quoted-time" datetime="2012-06-22T03:57:51+00:00">22.06.12, 03:57</time></span><div class='quote '>если число строк в Т1 менее 3-х выскакивает исключение List index out of bonds() с указание строки в скобках</div></div><br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">procedure CopyStringListLines(const aSrc: TStringList; var aDest: TStringList; aFirstLineIndex, aLinesCount: Integer);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;I: Integer;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if aSrc.Count - 1 &#60; aFirstLineIndex + aLinesCount then</div><div class="code_line">&nbsp;&nbsp; &nbsp;aLinesCount := aSrc.Count - 1 - aFirstLineIndex;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;for I := aFirstLineIndex to aFirstLineIndex + aLinesCount do</div><div class="code_line">&nbsp;&nbsp; &nbsp;aDest.Add(&#39;aSrc[I]&#39;);</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>VahaC</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158855</guid>
        <pubDate>Fri, 22 Jun 2012 04:44:35 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158855</link>
        <description><![CDATA[Anatoly Podgoretsky: Ну так проверь путем создания двух кусков кода и визуально сравни совпадают или нет,]]></description>
        <author>Anatoly Podgoretsky</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158841</guid>
        <pubDate>Fri, 22 Jun 2012 03:57:51 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158841</link>
        <description><![CDATA[Pcrepair: вариант хороший<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">for i := 0 to 2 do</div><div class="code_line">T2.Add(T1[i])</div></ol></div></div></div></div><br>
и все работаеь но такой косячок обнаружился:<br>
если число строк в Т1 менее 3-х выскакивает исключение List index out of bonds()  с указание строки в скобках, которой нехватает до 3-х<br>
<br>
вообще число вводимых в МЕМО строк может быть и менее 3-х. и что тут сделать? написать if i &lt; 3 then Exit(и вывести сообщение) перед всем. или есть другие варианты?<br>
может обойтись без цикла и просто написать:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">T2.Add(T1[0])</div><div class="code_line">T2.Add(T1[1])</div><div class="code_line">T2.Add(T1[2])</div></ol></div></div></div></div><br>
Какой вариант правильный с точки зрения теории и практики?]]></description>
        <author>Pcrepair</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158805</guid>
        <pubDate>Thu, 21 Jun 2012 20:22:39 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158805</link>
        <description><![CDATA[VahaC: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">For I := 0 to 2 do</div><div class="code_line">&nbsp;T2.Add(T1[I]);</div></ol></div></div></div></div>]]></description>
        <author>VahaC</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158747</guid>
        <pubDate>Thu, 21 Jun 2012 17:58:24 +0000</pubDate>
        <title>Переменная TStringList, копирование строк</title>
        <link>https://forum.sources.ru/index.php?showtopic=359596&amp;view=findpost&amp;p=3158747</link>
        <description><![CDATA[Pcrepair: Добрый день. есть следующее:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">var T1,T2:TstringList</div><div class="code_line">&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; T1 := TStringList.Create;</div><div class="code_line">&nbsp;&nbsp; T2 := TStringList.Create;</div><div class="code_line">&nbsp;&nbsp; T1.Text := Memo1.Text; (*вводим в Т1 10 строк текста(к примеру), каждая строка одно слово*)</div><div class="code_line">&nbsp;&nbsp; .......</div><div class="code_line">end.</div></ol></div></div></div></div><br>
<br>
Вопрос: как в Т2 скопировать только первые 3-и строки из Т1? что то сколько не смотрел методы и свойства TStringList так ничего и не увидел.]]></description>
        <author>Pcrepair</author>
        <category>Delphi: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	