<?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[Zeilenumbruch]]></title><description><![CDATA[<p>Hi</p>
<p>Wäre nett, wenn mir jemand sagen könnte, wie ich in ein Memo einen Zeilenumbruch bekomme.</p>
<p>Ich habe vor, einen chat zu schreiben, aber die ausgabe sieht immer so aus:</p>
<p>NICK SAGT: XXXXX</p>
<p>Es soll aber so aussehen:</p>
<p>NICK SAGT:<br />
XXXXXX</p>
<p>hier ist der teil im source, in dem die nachricht verschickt wird:</p>
<p>[cpp]ServerSocket1-&gt;Socket-&gt;Connections[0]-&gt;SendText(<strong>(nick-&gt;Text)+(Memo2-&gt;Text)</strong>);[/cpp]</p>
<p>Danke schonmal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>schnurres</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162631/zeilenumbruch</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 21:49:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162631.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Oct 2006 17:16:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeilenumbruch on Fri, 20 Oct 2006 17:16:33 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Wäre nett, wenn mir jemand sagen könnte, wie ich in ein Memo einen Zeilenumbruch bekomme.</p>
<p>Ich habe vor, einen chat zu schreiben, aber die ausgabe sieht immer so aus:</p>
<p>NICK SAGT: XXXXX</p>
<p>Es soll aber so aussehen:</p>
<p>NICK SAGT:<br />
XXXXXX</p>
<p>hier ist der teil im source, in dem die nachricht verschickt wird:</p>
<p>[cpp]ServerSocket1-&gt;Socket-&gt;Connections[0]-&gt;SendText(<strong>(nick-&gt;Text)+(Memo2-&gt;Text)</strong>);[/cpp]</p>
<p>Danke schonmal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>schnurres</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158457</guid><dc:creator><![CDATA[schnurres]]></dc:creator><pubDate>Fri, 20 Oct 2006 17:16:33 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Fri, 20 Oct 2006 17:24:05 GMT]]></title><description><![CDATA[<p>Siehe Escapesequenzen<br />
also</p>
<pre><code class="language-cpp">AnsiString tmp = Nick-&gt;Text + &quot;\n&quot; + WeitererText;
</code></pre>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158461</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Fri, 20 Oct 2006 17:24:05 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Fri, 20 Oct 2006 17:28:47 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>das reicht unter windows aber nicht aus, sondern da muß es so aussehen</p>
<pre><code class="language-cpp">AnsiString tmp = Nick-&gt;Text + &quot;\r\n&quot; + WeitererText;
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158464</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 20 Oct 2006 17:28:47 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Fri, 20 Oct 2006 18:28:56 GMT]]></title><description><![CDATA[<p>Danke euch beiden. Hat geklappt.</p>
<p>Was würde ich nur ohne dieses Forum hier machen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>Jetzt habe ich noch eine Frage:</p>
<p>Kann man irgendwie die Anzahl der connecteten Pcs bestimmen?<br />
Wenn ja, wie ?</p>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158472</guid><dc:creator><![CDATA[schnurres]]></dc:creator><pubDate>Fri, 20 Oct 2006 18:28:56 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Fri, 20 Oct 2006 23:00:17 GMT]]></title><description><![CDATA[<p>...ja, mit ActiveConnections.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158492</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158492</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Fri, 20 Oct 2006 23:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sat, 21 Oct 2006 09:57:18 GMT]]></title><description><![CDATA[<p>also ehrlich gesagt, habe ich jetzt ganz den überblick über die 2 programme verloren <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Ich habe vor, den SERVER(Programm) auf meinem Server(pc) zu starten, damit MEHRERE clienten connecten können.Leider funktioniert das aber noch nicht. Kann mir jemand helfen??</p>
<p>hier der Quellcode von beiden Dateien:</p>
<p>SERVER:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{

ServerSocket1-&gt;Open();
}

//---------------------------------------------------------------------------

void __fastcall TForm1::ServerSocket1Accept(TObject *Sender,
      TCustomWinSocket *Socket)
{
    Label2-&gt;Visible = false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
      TCustomWinSocket *Socket)
{
  Memo1-&gt;Lines-&gt;Add(Socket-&gt;ReceiveText());
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
 if(Memo2-&gt;Text != &quot;&quot;);
  {

  ServerSocket1-&gt;Socket-&gt;Connections[0]-&gt;SendText((nick-&gt;Text)+&quot;sagt:\r\n&quot;+(Memo2-&gt;Text));
   Memo1-&gt;Lines-&gt;Add((nick-&gt;Text)+&quot;\r\n&quot;+(Memo2-&gt;Text));
   Memo2-&gt;Text = &quot;&quot;;
   Memo2-&gt;SetFocus();
  }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ServerSocket1ClientDisconnect(TObject *Sender,
      TCustomWinSocket *Socket)
{
   Label2-&gt;Visible = true;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Memo2KeyDown(TObject *Sender, WORD &amp;Key,
      TShiftState Shift)
{
if(Key == VK_RETURN)
{
  ServerSocket1-&gt;Socket-&gt;Connections[0]-&gt;SendText((nick-&gt;Text)+ &quot; sagt: \r\n&quot;+(Memo2-&gt;Text));
   Memo1-&gt;Lines-&gt;Add((nick-&gt;Text) + &quot; sagt: \r\n&quot;+(Memo2-&gt;Text));
   Memo2-&gt;Text = &quot;&quot;;
   Memo2-&gt;SetFocus();
  }
}
</code></pre>
<p>CLIENT:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
const int freePort = 5000;
AnsiString freeHost;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
  Image5-&gt;Visible = false;
}
//--------------------------------------------------------------------------

void __fastcall TForm1::ClientSocket1Error(TObject *Sender,
      TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int &amp;ErrorCode)
{
ShowMessage(&quot;Kein Server gefunden&quot;);
Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ClientSocket1Connect(TObject *Sender,
      TCustomWinSocket *Socket)
{
Label4-&gt;Visible = false;
Image4-&gt;Visible = false;
Image5-&gt;Visible = true;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ClientSocket1Read(TObject *Sender,
      TCustomWinSocket *Socket)
{
Memo2-&gt;Lines-&gt;Add(Socket-&gt;ReceiveText());        
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Memo1KeyDown(TObject *Sender, WORD &amp;Key,
      TShiftState Shift)
{
if(Key == VK_RETURN)
{
if(nick-&gt;Text == &quot;&quot;)
   {
   ShowMessage(&quot;Bitte zuerst einen Nickname eingeben&quot;);
   }
  else
  {
  ClientSocket1-&gt;Socket-&gt;SendText((nick-&gt;Text)+&quot; sagt:\r\n&quot;+(Memo1-&gt;Text));
  Memo2-&gt;Lines-&gt;Add((nick-&gt;Text)+&quot; sagt:\r\n&quot;+(Memo1-&gt;Text));
  Memo1-&gt;Text = &quot;&quot;;
  Memo1-&gt;SetFocus();
  }
}
  }
//---------------------------------------------------------------------------

void __fastcall TForm1::Image2Click(TObject *Sender)
{
if((ip-Text.Length()) &gt; 0)
  {
     freeHost = ip-&gt;Text;
     ClientSocket1-&gt;Host = freeHost;
      ClientSocket1-&gt;Active = true;
      }
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ClientSocket1Disconnect(TObject *Sender,
      TCustomWinSocket *Socket)
{
Label4-&gt;Visible = true;
Image4-&gt;Visible = true;
Image5-&gt;Visible =  false;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image3Click(TObject *Sender)
{
ClientSocket1-&gt;Active = false;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Image7Click(TObject *Sender)
{
if(Memo1 != &quot;&quot;)
{
ClientSocket1-&gt;Socket-&gt;SendText((nick-&gt;Text)+&quot; sagt:\r\n&quot;+(Memo1-&gt;Text));
  Memo2-&gt;Lines-&gt;Add((nick-&gt;Text)+&quot; sagt:\r\n&quot;+(Memo1-&gt;Text));
  Memo1-&gt;Text = &quot;&quot;;
 Memo1-&gt;SetFocus();
 }
 }
//---------------------------------------------------------------------------

void __fastcall TForm1::Image6Click(TObject *Sender)
{
ClientSocket1-&gt;Close();
Close();
}
</code></pre>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158582</guid><dc:creator><![CDATA[schnurres]]></dc:creator><pubDate>Sat, 21 Oct 2006 09:57:18 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sat, 21 Oct 2006 13:20:57 GMT]]></title><description><![CDATA[<p>WAS genau funktioniert denn nicht?<br />
Habe Deinen Code schnell überflogen und gesehen, dass der Server Informationen über Connections[0] versendet. Das heisst ja, dass nur der erste Client etwas empfängt und alle anderen gehen leer aus. Du musst das Senden des Sockets mit z.B. Hilfe einer Schleife und ActiveConnections lösen.</p>
<p>Weiterhin ist mir aufgefallen, dass ein Client, der Text sendet, diesen lediglich an den Server schickt. Dort müsste der Server dann diesen Text an alle Clients weiterversenden(siehe oben).</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158735</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Sat, 21 Oct 2006 13:20:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sat, 21 Oct 2006 14:12:37 GMT]]></title><description><![CDATA[<p>ok so langsam verstehe ich das ganze.</p>
<p>Nur ich bekomme das mit dem verbindungen nicht hin.</p>
<p>die for-schleife muss ja so in etwa aussehn:</p>
<pre><code class="language-cpp">for(int i = 0;0 =&lt; ANZAHL DER VERBINDUNGEN;i++)
{
ServerSocket1-&gt;Socket-&gt;Connections[i]-&gt;SendText((nick-&gt;Text)+&quot;sagt:\r\n&quot;+(Memo2-&gt;Text));
}
</code></pre>
<p>mein Problem ist jetzt, dass ich nicht genau weiß, was ich für &quot;ANZAHL DER VERBINDUNGEN&quot; einsetzen soll.<br />
Mit ActiveConnections habe ich es auch schon versucht, aber ohne erfolg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158772</guid><dc:creator><![CDATA[schnurres]]></dc:creator><pubDate>Sat, 21 Oct 2006 14:12:37 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sun, 22 Oct 2006 00:24:57 GMT]]></title><description><![CDATA[<p>Ok..., so müsste es aussehen:</p>
<pre><code class="language-cpp">int Verbindungen = ServerSocket1-&gt;Socket-&gt;ActiveConnections;
 for(int x = 0; x &lt;= Verbindungen - 1; x++)
   ServerSocket1-&gt;Socket-&gt;Connections[x]-&gt;SendText(&quot;Dein Text&quot;);
</code></pre>
<p>Gruss Rostfrei[]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158852</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Sun, 22 Oct 2006 00:24:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sun, 22 Oct 2006 00:35:29 GMT]]></title><description><![CDATA[<p>Was hat das mit dem Zeilenumbruch zu tun?<br />
Bitte die Faustregel beachten: ein Thema pro Thread, ein Thread pro Thema. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158855</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 22 Oct 2006 00:35:29 GMT</pubDate></item><item><title><![CDATA[Reply to Zeilenumbruch on Sun, 22 Oct 2006 08:23:17 GMT]]></title><description><![CDATA[<p>ok werde ich das nächste mal beachten.</p>
<p>Ich habe das Problem auch gelöst. Danke an alle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158894</guid><dc:creator><![CDATA[schnurres]]></dc:creator><pubDate>Sun, 22 Oct 2006 08:23:17 GMT</pubDate></item></channel></rss>