<?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[Schnelle Hilfe !!! Danke !!!]]></title><description><![CDATA[<p>Ich will eine Gleichung mit meinem Borland C++ Builder programmieren.</p>
<p>y= ax2 + bx + c</p>
<p>Ich habe irgendwie ziemliche Probleme, da das mit dem Memo nicht richtig<br />
funktioniert.</p>
<p>So sieht es aus:</p>
<p>//---------------------------------------------------------------------------<br />
#include &lt;vcl\vcl.h&gt;<br />
#pragma hdrstop</p>
<p>#include &quot;Unit1.h&quot;<br />
//---------------------------------------------------------------------------<br />
#pragma resource &quot;*.dfm&quot;<br />
TForm1 <em>Form1;<br />
int a, b, c, xMin, xMax, y, x, s, dummy;<br />
//---------------------------------------------------------------------------<br />
__fastcall TForm1::TForm1(TComponent</em> Owner)<br />
: TForm(Owner)<br />
{<br />
}<br />
//---------------------------------------------------------------------------<br />
void __fastcall TForm1::Button1Click(TObject *Sender)<br />
{<br />
a = StrToInt (Edit1-&gt;Text);<br />
b = StrToInt (Edit2-&gt;Text);<br />
c = StrToInt (Edit3-&gt;Text);<br />
xMin = StrToInt (Edit4-&gt;Text);<br />
xMax = StrToInt (Edit5-&gt;Text);</p>
<p>for (int x=xMin; x&lt;=xMax; x++)<br />
String (dummy) = String (x) +&quot; &quot;+ String (y);</p>
<p>x= xMin;<br />
y = a*x*x + b*x + c;</p>
<p>Memo1-&gt;Lines-&gt;Add(String(dummy));<br />
}<br />
//---------------------------------------------------------------------------</p>
<p>Das Bild findet ihr hier:</p>
<p><a href="http://people.freenet.de/fusionworld/c++.jpg" rel="nofollow">http://people.freenet.de/fusionworld/c++.jpg</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75598/schnelle-hilfe-danke</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 16:00:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75598.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jun 2004 12:56:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 12:56:44 GMT]]></title><description><![CDATA[<p>Ich will eine Gleichung mit meinem Borland C++ Builder programmieren.</p>
<p>y= ax2 + bx + c</p>
<p>Ich habe irgendwie ziemliche Probleme, da das mit dem Memo nicht richtig<br />
funktioniert.</p>
<p>So sieht es aus:</p>
<p>//---------------------------------------------------------------------------<br />
#include &lt;vcl\vcl.h&gt;<br />
#pragma hdrstop</p>
<p>#include &quot;Unit1.h&quot;<br />
//---------------------------------------------------------------------------<br />
#pragma resource &quot;*.dfm&quot;<br />
TForm1 <em>Form1;<br />
int a, b, c, xMin, xMax, y, x, s, dummy;<br />
//---------------------------------------------------------------------------<br />
__fastcall TForm1::TForm1(TComponent</em> Owner)<br />
: TForm(Owner)<br />
{<br />
}<br />
//---------------------------------------------------------------------------<br />
void __fastcall TForm1::Button1Click(TObject *Sender)<br />
{<br />
a = StrToInt (Edit1-&gt;Text);<br />
b = StrToInt (Edit2-&gt;Text);<br />
c = StrToInt (Edit3-&gt;Text);<br />
xMin = StrToInt (Edit4-&gt;Text);<br />
xMax = StrToInt (Edit5-&gt;Text);</p>
<p>for (int x=xMin; x&lt;=xMax; x++)<br />
String (dummy) = String (x) +&quot; &quot;+ String (y);</p>
<p>x= xMin;<br />
y = a*x*x + b*x + c;</p>
<p>Memo1-&gt;Lines-&gt;Add(String(dummy));<br />
}<br />
//---------------------------------------------------------------------------</p>
<p>Das Bild findet ihr hier:</p>
<p><a href="http://people.freenet.de/fusionworld/c++.jpg" rel="nofollow">http://people.freenet.de/fusionworld/c++.jpg</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/531599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531599</guid><dc:creator><![CDATA[metroid]]></dc:creator><pubDate>Wed, 02 Jun 2004 12:56:44 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:02:50 GMT]]></title><description><![CDATA[<p>&quot;Funktioniert nicht&quot; ist keine ausreichende Fehlermeldung oder Problembeschreibung.</p>
<p>Und wenn du dir überlegt hast, was genau das Problem ist, dann kannst du auch eine aussagekräftige Überschrift formulieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/531608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531608</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:07:27 GMT]]></title><description><![CDATA[<p>int a, b, c, xMin, xMax, y, x, s, dummy;</p>
<p>das gehört in die Header-Datei des Forms unter public: oder private:...</p>
<p>String (dummy) = String (x) +&quot; &quot;+ String (y);<br />
Was soll die Zeile bewirken??</p>
<p>Eventuell das hier?</p>
<pre><code class="language-cpp">for (int x=xMin; x&lt;=xMax; x++)
{
   y = a*x*x + b*x + c;
   Memo1-&gt;Lines-&gt;Add(AnsiString(x) + &quot; &quot; + AnsiString(y)); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/531613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531613</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:07:27 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:22:05 GMT]]></title><description><![CDATA[<p>Es ändert sich nichts.<br />
Das Problem liegt beim Memo.<br />
Im Memo sollen die Variablen x und y nebeneinander stehen.</p>
<p>Borland zeigt mir aber nur y an.</p>
<p>Wie kann man denn in einem Memo mehrere Variablen oder Zahlen nebeneinander stehen haben ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/531625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531625</guid><dc:creator><![CDATA[metroid]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:22:05 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:24:22 GMT]]></title><description><![CDATA[<p>Indem du sie in eine Zeile, d.h. beide in einen String schreibst bzw. sie zu einem String zusammenfasst!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/531628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531628</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:24:22 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:28:54 GMT]]></title><description><![CDATA[<p>das habe ich doch oben schon gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/531630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531630</guid><dc:creator><![CDATA[metroid]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:35:05 GMT]]></title><description><![CDATA[<p>Ist schon komisch, Metroid,</p>
<p>ich hab's gerade ausprobiert, mein Beispiel funktioniert einwandfrei...</p>
<p>Noch mal die ganze Button1-Funktion:</p>
<pre><code class="language-cpp">a = StrToInt (Edit1-&gt;Text); 
   b = StrToInt (Edit2-&gt;Text); 
   c = StrToInt (Edit3-&gt;Text); 
   xMin = StrToInt (Edit4-&gt;Text); 
   xMax = StrToInt (Edit5-&gt;Text); 
   for (int x=xMin; x&lt;=xMax; x++)
   {
      y = a*x*x + b*x + c;
      Memo1-&gt;Lines-&gt;Add(AnsiString(x) + &quot; &quot; + AnsiString(y)); 
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/531639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531639</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:35:05 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:40:53 GMT]]></title><description><![CDATA[<p>Bei mir funkts jetzt auch einwandfrei !!!!!!!</p>
<p>Danke</p>
<p>Metroid <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/531645</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531645</guid><dc:creator><![CDATA[metroid]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:40:53 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:43:13 GMT]]></title><description><![CDATA[<p>achso, mit String(dummy) erzeugst Du einen temporären String aus dem Wert dummy.</p>
<p>Um einen Ausgabestring zu erzeugen, mußt Du ihn auch deklarieren, zb mit:</p>
<pre><code class="language-cpp">AnsiString OutString;

for (int x=xMin; x&lt;=xMax; x++)
{
  y = a*x*x + b*x + c;
  OutString = AnsiString(x) + &quot; &quot; + AnsiString(y); 
  Memo1-&gt;Lines-&gt;Add(OutString);
}
</code></pre>
<p>Wenn Du erst alle Ausgabestrings zwischenpuffern möchtest, bevor Du sie dem Memo zuweist: Schau Dir mal TStringList an...</p>
<pre><code class="language-cpp">AnsiString OutString;
TStringList* slTemp = new TStringList();

for (int x=xMin; x&lt;=xMax; x++)
{
  y = a*x*x + b*x + c;
  OutString = AnsiString(x) + &quot; &quot; + AnsiString(y); 
  slTemp-&gt;Add(OutString);
} 
Memo1-&gt;Text = slTemp-&gt;Text;
delete slTemp;  // wichtig, dynamisch erzeugte Objekte auch wieder löschen...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/531647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531647</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:43:13 GMT</pubDate></item><item><title><![CDATA[Reply to Schnelle Hilfe !!! Danke !!! on Wed, 02 Jun 2004 13:43:17 GMT]]></title><description><![CDATA[<p>metroid schrieb:</p>
<blockquote>
<p>das habe ich doch oben schon gemacht.</p>
</blockquote>
<p>Eben nicht. Mit <em>String (dummy) = String (x) +&quot; &quot;+ String (y);</em> hast du (implizit) einen temporären String mit dem (umgewandelten) Wert von <em>dummy</em> erzeugt und ihm anschliessend x+y zugewiesen.<br />
Dadurch hat sich am Wert des Integer <em>dummy</em> aber nichts geändert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/531648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/531648</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 02 Jun 2004 13:43:17 GMT</pubDate></item></channel></rss>