<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[komponenten name + variablen?]]></title><description><![CDATA[<p>hallo an alle, ich wollte einmal wissen, ob ich folgenden code auch kürzer schreiben kann:</p>
<p>(Situation 4 Edit felder von Edit1 bis Edit4)</p>
<pre><code class="language-cpp">for(x=1;x&lt;=4;x++)
  {
      if(x==1)
      {
       i_block[x]=StrToInt(Edit1-&gt;Text);
      }

        if(x==2)
        {
          i_block[x]=StrToInt(Edit2-&gt;Text);
        }

          if(x==3)
          {
            i_block[x]=StrToInt(Edit3-&gt;Text);
          }

           if(x==4)
           {
             i_block[x]=StrToInt(Edit4-&gt;Text);
           }
   }
</code></pre>
<p>wie kann ich das machen, das er hinter den Edit die var x angenommen wird? bsp so: 8was nicht funtzt</p>
<pre><code class="language-cpp">for(x=1;x&lt;=4;x++)
  {

       i_block[x]=StrToInt(Edit[x]-&gt;Text);
       //oder
       i_block[x]=StrToInt(Edit&quot;+x+&quot;-&gt;Text);

   }
</code></pre>
<p>auf eine antwort würde ich mich sehr freuen und währe auch sehr dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/108600/komponenten-name-variablen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 02:34:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/108600.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 May 2005 10:18:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 10:18:32 GMT]]></title><description><![CDATA[<p>hallo an alle, ich wollte einmal wissen, ob ich folgenden code auch kürzer schreiben kann:</p>
<p>(Situation 4 Edit felder von Edit1 bis Edit4)</p>
<pre><code class="language-cpp">for(x=1;x&lt;=4;x++)
  {
      if(x==1)
      {
       i_block[x]=StrToInt(Edit1-&gt;Text);
      }

        if(x==2)
        {
          i_block[x]=StrToInt(Edit2-&gt;Text);
        }

          if(x==3)
          {
            i_block[x]=StrToInt(Edit3-&gt;Text);
          }

           if(x==4)
           {
             i_block[x]=StrToInt(Edit4-&gt;Text);
           }
   }
</code></pre>
<p>wie kann ich das machen, das er hinter den Edit die var x angenommen wird? bsp so: 8was nicht funtzt</p>
<pre><code class="language-cpp">for(x=1;x&lt;=4;x++)
  {

       i_block[x]=StrToInt(Edit[x]-&gt;Text);
       //oder
       i_block[x]=StrToInt(Edit&quot;+x+&quot;-&gt;Text);

   }
</code></pre>
<p>auf eine antwort würde ich mich sehr freuen und währe auch sehr dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/779443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779443</guid><dc:creator><![CDATA[ThorstenSteinberg]]></dc:creator><pubDate>Sun, 01 May 2005 10:18:32 GMT</pubDate></item><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 10:25:39 GMT]]></title><description><![CDATA[<p>Siehe <a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39305" rel="nofollow">FAQ</a> im Abschnitt &quot;Komponenten benutzen&quot;: &quot;zur Laufzeit erstellen&quot;, &quot;Zugriff nicht über Namen&quot; und &quot;dynamische Arrays&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/779446</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779446</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 01 May 2005 10:25:39 GMT</pubDate></item><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 10:38:46 GMT]]></title><description><![CDATA[<p>Hallo Thorsten,<br />
Jansen hat ja bereits auf dein Prolem geantwortet aber ich habe einen Kommentar zu deinem bisherigen Code. Meinst Du nicht, das die Verwendung von else if besser ist als die if Bedingungen, da der Wert von x ja innerhalb der Bedingungen nicht verändert wird und so nur unnötig viele Bedingungen überprüft werden.</p>
<p>Gruß Alex</p>
]]></description><link>https://www.c-plusplus.net/forum/post/779453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779453</guid><dc:creator><![CDATA[Alex_H]]></dc:creator><pubDate>Sun, 01 May 2005 10:38:46 GMT</pubDate></item><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 10:55:09 GMT]]></title><description><![CDATA[<p>Da muss ich doch noch nen Kommentar zum Kommentar abgeben: Ich denke ein Switch..case-Konstrukt wäre hier noch vielpassender... allerdings ist Jansens Lösungsansatz wesentlich besser...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/779463</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779463</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Sun, 01 May 2005 10:55:09 GMT</pubDate></item><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 11:03:00 GMT]]></title><description><![CDATA[<p>jo vielen dank hat funktioniert !</p>
<p>Edit habe es folgender maßen nun gemacht:</p>
<pre><code class="language-cpp">//Dynamische Erzeugung der TextBoxen
   int l=112; //Start der linken position

   txt_block.Length=5;  //anzahl der textfelder (5=4)

   for(int i=1;i&lt;5;i++)
   {
     txt_block[i] = new TEdit(this);  //neues edit
     txt_block[i]-&gt;Parent = this;     //parent angabe
     txt_block[i]-&gt;Left = l;          //linke position
     txt_block[i]-&gt;Width = 33;        //breite
     txt_block[i]-&gt;Top = 48;          //top position
     txt_block[i]-&gt;MaxLength = 3;     //maximale eingabe länge
     txt_block[i]-&gt;Show();            //textfeld anzeigen

     l=l+48;   //linke postion um 48 erhöhen
   }
</code></pre>
<p>im klick ereigniss</p>
<pre><code class="language-cpp">i_block[x]=StrToInt(txt_block[x]-&gt;Text);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/779467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779467</guid><dc:creator><![CDATA[ThorstenSteinberg]]></dc:creator><pubDate>Sun, 01 May 2005 11:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to komponenten name + variablen? on Sun, 01 May 2005 11:12:33 GMT]]></title><description><![CDATA[<p>Hallo Unix<br />
Kommentar die dritte:<br />
<a href="http://www.dotnet-hb.de/default.aspx?page=47&amp;id=406" rel="nofollow">http://www.dotnet-hb.de/default.aspx?page=47&amp;id=406</a><br />
Ich weiß es ist Haarspalterei und natürlich ist die Lösung von Jansen die schönste.</p>
<p>Gruß Alex</p>
<p>PS: Wenn ich zu weit vom Thema abkomme schreit mich einfach an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/779473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/779473</guid><dc:creator><![CDATA[Alex_H]]></dc:creator><pubDate>Sun, 01 May 2005 11:12:33 GMT</pubDate></item></channel></rss>