<?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=311997&amp;view=findpost&amp;p=2682472</guid>
        <pubDate>Sun, 29 Aug 2010 19:55:11 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682472</link>
        <description><![CDATA[SkAndriy: Спасибо за помощь. все получилось.]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682466</guid>
        <pubDate>Sun, 29 Aug 2010 19:49:41 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682466</link>
        <description><![CDATA[Keeper89: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=311997&view=findpost&p=2682423'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Демо &#064; <time class="tag-quote__quoted-time" datetime="2010-08-29T18:58:45+00:00">29.08.10, 18:58</time></span><div class='quote '>Так массив или поля всё-таки?<br>
Изврат какой-то.</div></div><br>
собственно и я о чем, в одном месте хочется поля, в другом - массив.<br>
<br>
Судя по задаче не надо никаких h1, h2,..,h7, а нужен массив h.:<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">...</div><div class="code_line">const H_COUNT = 7;</div><div class="code_line">...</div><div class="code_line">private</div><div class="code_line">&nbsp;&nbsp;Fh: array[1..H_COUNT] of Double;</div><div class="code_line">&nbsp;&nbsp;function GetArray(Index: Integer): Double;</div><div class="code_line">&nbsp;&nbsp;procedure SetArray(Index: Integer; const Value: Double);</div><div class="code_line">...</div><div class="code_line">published</div><div class="code_line">&nbsp;&nbsp;property H[index: integer]: Double read GetArray write SetArray;</div><div class="code_line">&nbsp;</div><div class="code_line">...</div><div class="code_line">implementation</div><div class="code_line">...</div><div class="code_line">&nbsp;</div><div class="code_line">function MyComponent.GetArray(Index: Integer): Double;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Result := Fh[Index];</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure MyComponent.SetArray(Index: Integer; const Value: Double);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Fh[Index] := Value;</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Как-то так. Стоит, наверное, еще добавить и проверку Index&#39;а.]]></description>
        <author>Keeper89</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682423</guid>
        <pubDate>Sun, 29 Aug 2010 18:58:45 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682423</link>
        <description><![CDATA[Демо: Добавь эту строку в секцию public и нажми Ctrl-Shift-C... <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2010-08-29T18:59:13+00:00">29.08.10, 18:59</time></span></span><br>
Так массив или поля всё-таки? <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2010-08-29T19:00:35+00:00">29.08.10, 19:00</time></span></span><br>
Изврат какой-то.<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">case index of</div><div class="code_line">&nbsp;&nbsp;0: Result := h0;</div><div class="code_line">&nbsp;&nbsp;1: Result := h2;</div><div class="code_line">&nbsp;&nbsp;...</div><div class="code_line">&nbsp;&nbsp;7: &nbsp;Result := h7;</div><div class="code_line">else Result := -1;</div><div class="code_line">end;</div></ol></div></div></div></div>]]></description>
        <author>Демо</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682416</guid>
        <pubDate>Sun, 29 Aug 2010 18:52:58 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682416</link>
        <description><![CDATA[SkAndriy: Это понятно, а как CArray поймет, что нужно ему выводить? Что именно значения полей h1-h7? Вот в чем вопрос. Спасибо]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682411</guid>
        <pubDate>Sun, 29 Aug 2010 18:47:27 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682411</link>
        <description><![CDATA[Демо: <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">property CArray[index: integer]: Double read GetArray write SetArray;</div></ol></div></div></div></div>]]></description>
        <author>Демо</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682394</guid>
        <pubDate>Sun, 29 Aug 2010 18:28:11 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682394</link>
        <description><![CDATA[SkAndriy: Задача следующая:<br>
<br>
В realtime значения полей h1-h7 выводить не по отдельности, например, пременная1 := MyComponent1.h1 и так далее пременная7 := MyComponent1.h7, а через некий массив:<br>
<br>
for i := 0 to 6 do<br>
  myarray[i] := MyComponent1.arrayvalueaofproperties1_7[i]<br>
<br>
Теперь понятно показал?<br>
<br>
Спасибо]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682391</guid>
        <pubDate>Sun, 29 Aug 2010 18:20:31 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682391</link>
        <description><![CDATA[Keeper89: Я не совсем Вас понимаю, покажете картинку-пример, то такое &quot;вывести в виде массива&quot;?]]></description>
        <author>Keeper89</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682383</guid>
        <pubDate>Sun, 29 Aug 2010 18:10:29 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682383</link>
        <description><![CDATA[SkAndriy: Поробовал вот такую конструкцию, но она не работает тоже:<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">unit MyComponent;</div><div class="code_line">&nbsp;</div><div class="code_line">interface</div><div class="code_line">&nbsp;</div><div class="code_line">uses Windows, Messages, SysUtils, Variants, Classes, Controls;</div><div class="code_line">&nbsp;</div><div class="code_line">type</div><div class="code_line">&nbsp;&nbsp;TMyComponent = class(TComponent)</div><div class="code_line">&nbsp;&nbsp;private</div><div class="code_line">&nbsp;&nbsp; &nbsp;fIndex : Integer;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh1: Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh2 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh3 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh4 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh5 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh6 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh7 : Double;</div><div class="code_line">&nbsp;&nbsp; function &nbsp;GetMyFunc(Index: Integer): Double;</div><div class="code_line">&nbsp;&nbsp;protected</div><div class="code_line">&nbsp;&nbsp; &nbsp;//...............</div><div class="code_line">&nbsp;&nbsp;public</div><div class="code_line">&nbsp;&nbsp; &nbsp;constructor Create(AOwner: TComponent);override;</div><div class="code_line">&nbsp;&nbsp; &nbsp;destructor Destroy;override;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure Assign(Source: TPersistent);</div><div class="code_line">&nbsp;&nbsp; &nbsp;property MyArray[Index: Integer] : Double read GetMyFunc;</div><div class="code_line">&nbsp;&nbsp;published</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h1 : Double index 0 read GetMyFunct write fh1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h2 : Double index 1 read GetMyFunc write fh2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h3 : Double index 2 read GetMyFunc write fh3;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h4 : Double index 3 read GetMyFunc write fh4;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h5 : Double index 4 read GetMyFunc write fh5;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h6 : Double index 5 read GetMyFunc write fh6;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h7 : Double index 6 read GetMyFunc write fh7;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;procedure Register;</div><div class="code_line">&nbsp;</div><div class="code_line">implementation</div><div class="code_line">&nbsp;</div><div class="code_line">{ TMyComponent }</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.Oma(U : Integer): Double;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Result := 100/Random(U);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TMyComponent.Assign(Source: TPersistent);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if Source is TMyComponent then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh1 := TMyComponent(Source).h1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh2 := TMyComponent(Source).h2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh3 := TMyComponent(Source).h3;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh4 := TMyComponent(Source).h4;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh5 := TMyComponent(Source).h5;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh6 := TMyComponent(Source).h6;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh7 := TMyComponent(Source).h7;</div><div class="code_line">&nbsp;end</div><div class="code_line">&nbsp;else inherited Assign(Source);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.GetMyFunc(Index : Integer): Double;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if (Index &#62;= 0) and (Index &#60;= 6) then</div><div class="code_line">&nbsp;&nbsp; case Index of</div><div class="code_line">&nbsp;&nbsp; &nbsp;0 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;1 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;2 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;3 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;4 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;5 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;6 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp;end</div><div class="code_line">&nbsp;&nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;Result := -1;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">constructor TMyComponent.Create(AOwner: TComponent);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;inherited;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">destructor TMyComponent.Destroy;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;inherited;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Register;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;RegisterComponents(&#39;test&#39;, [TMyComponent]);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">end.</div></ol></div></div></div></div><br>
<br>
Подскажите где ошибка?<br>
<br>
Спасибо]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682346</guid>
        <pubDate>Sun, 29 Aug 2010 16:48:25 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682346</link>
        <description><![CDATA[SkAndriy: Да они видны, просто мне нужно их вывести в виде массива. Спасибо.]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682341</guid>
        <pubDate>Sun, 29 Aug 2010 16:35:17 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682341</link>
        <description><![CDATA[Keeper89: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=311997&view=findpost&p=2682337'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>SkAndriy &#064; <time class="tag-quote__quoted-time" datetime="2010-08-29T16:18:10+00:00">29.08.10, 16:18</time></span><div class='quote '>как можно и дизайнтайме показать значения свойств property h1, property h2, property h3, property h4, property h5, property h6, property h7 в Инстпекторе Объектов</div></div><br>
разве при объявлении в секции published они уже не должны отображаться?<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=311997&view=findpost&p=2682337'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>SkAndriy &#064; <time class="tag-quote__quoted-time" datetime="2010-08-29T16:18:10+00:00">29.08.10, 16:18</time></span><div class='quote '>в realtime выводить значения этих свойств не по одному, а через массив, используя конструкцию for i :=0 to High(массив) do с доступом к каждому из property h1, property h2, property h3, property h4, property h5, property h6, property h7</div></div><br>
можно открыть функцию GetDataElement, и, если кол-во h всегда постоянно завести константу в классе, для которой использовать цикл for:<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 := 1 to H_COUNT do</div><div class="code_line">&nbsp;&nbsp;Showmessage(FloatToStr(GetDataElement(i-1)));</div></ol></div></div></div></div><br>
Хотя в таком случае вся структура компонента кажется странноватой. &lt;_&lt;]]></description>
        <author>Keeper89</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682337</guid>
        <pubDate>Sun, 29 Aug 2010 16:18:10 +0000</pubDate>
        <title>Как правильно выводить значения свойств через массив.</title>
        <link>https://forum.sources.ru/index.php?showtopic=311997&amp;view=findpost&amp;p=2682337</link>
        <description><![CDATA[SkAndriy: Добрый вечер&#33;<br>
<br>
Создан компонент по такой схеме:<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">unit MyComponent;</div><div class="code_line">&nbsp;</div><div class="code_line">interface</div><div class="code_line">&nbsp;</div><div class="code_line">uses Windows, Messages, SysUtils, Variants, Classes, Controls;</div><div class="code_line">&nbsp;</div><div class="code_line">type</div><div class="code_line">&nbsp;&nbsp;TMyComponent = class(TComponent)</div><div class="code_line">&nbsp;&nbsp;private</div><div class="code_line">&nbsp;&nbsp; &nbsp;fIndex : Integer;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh1: Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh2 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh3 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh4 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh5 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh6 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh7 : Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;function GetIndex : Integer;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure SetIndex(Value : Integer);</div><div class="code_line">&nbsp;&nbsp; &nbsp;function GetElement(Index : Integer): Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;function GetDataElement(Index : Integer): Double;</div><div class="code_line">&nbsp;&nbsp;protected</div><div class="code_line">&nbsp;&nbsp; &nbsp;//...............</div><div class="code_line">&nbsp;&nbsp;public</div><div class="code_line">&nbsp;&nbsp; &nbsp;constructor Create(AOwner: TComponent);override;</div><div class="code_line">&nbsp;&nbsp; &nbsp;destructor Destroy;override;</div><div class="code_line">&nbsp;&nbsp; &nbsp;function Oma(U : Integer): Double;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure Assign(Source: TPersistent);</div><div class="code_line">&nbsp;&nbsp; &nbsp;property Element[Index : Integer] : Double read GetElement;</div><div class="code_line">&nbsp;&nbsp;published</div><div class="code_line">&nbsp;&nbsp; &nbsp;property IndexElement : Integer read GetIndex write SetIndex;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h1 : Double index 0 read GetDataElement write fh1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h2 : Double index 1 read GetDataElement write fh2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h3 : Double index 2 read GetDataElement write fh3;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h4 : Double index 3 read GetDataElement write fh4;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h5 : Double index 4 read GetDataElement write fh5;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h6 : Double index 5 read GetDataElement write fh6;</div><div class="code_line">&nbsp;&nbsp; &nbsp;property h7 : Double index 6 read GetDataElement write fh7;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp;procedure Register;</div><div class="code_line">&nbsp;</div><div class="code_line">implementation</div><div class="code_line">&nbsp;</div><div class="code_line">{ TMyComponent }</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.Oma(U : Integer): Double;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Result := 100/Random(U);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TMyComponent.Assign(Source: TPersistent);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if Source is TMyComponent then</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh1 := TMyComponent(Source).h1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh2 := TMyComponent(Source).h2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh3 := TMyComponent(Source).h3;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh4 := TMyComponent(Source).h4;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh5 := TMyComponent(Source).h5;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh6 := TMyComponent(Source).h6;</div><div class="code_line">&nbsp;&nbsp; &nbsp;fh7 := TMyComponent(Source).h7;</div><div class="code_line">&nbsp;end</div><div class="code_line">&nbsp;else inherited Assign(Source);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.GetElement(Index : Integer): Double;</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;Result := 0;</div><div class="code_line">&nbsp;&nbsp;for i:= 0 to 6 do</div><div class="code_line">&nbsp;&nbsp;begin</div><div class="code_line">&nbsp;&nbsp;if (Index&#60;=0) or (Index&#62;7) then</div><div class="code_line">&nbsp;&nbsp; raise Exception.Create( &#39;Номер в массиве должен быть числом от 0 до 6&#39;)</div><div class="code_line">&nbsp;&nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;Result := i;</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.GetDataElement(Index : Integer): Double;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Result := 0;</div><div class="code_line">&nbsp;&nbsp;case Index of</div><div class="code_line">&nbsp;&nbsp; &nbsp;0 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;1 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;2 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;3 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;4 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;5 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp; &nbsp;6 : Result := Oma(fIndex);</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">constructor TMyComponent.Create(AOwner: TComponent);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;inherited;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">destructor TMyComponent.Destroy;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;inherited;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">function TMyComponent.GetIndex : Integer;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;Result := FIndex;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TMyComponent.SetIndex(Value : Integer);</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if Value&#60;&#62;fIndex then</div><div class="code_line">&nbsp;&nbsp; &nbsp;fIndex := Value;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure Register;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;RegisterComponents(&#39;test&#39;, [TMyComponent]);</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">end.</div></ol></div></div></div></div><br>
<br>
Вопрос: как можно и дизайнтайме показать значения свойств property h1, property h2, property h3, property h4, property h5, property h6, property h7 в Инстпекторе Объектов и в realtime выводить значения этих свойств не по одному, а через массив, используя конструкцию for i :=0 to High(массив) do с доступом к каждому из property h1, property h2, property h3, property h4, property h5, property h6, property h7.<br>
<br>
Спасибо.]]></description>
        <author>SkAndriy</author>
        <category>Delphi: Разработка компонентов</category>
      </item>
	
      </channel>
      </rss>
	