Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Delphi 2009 Error: potential data loss from 'TCaption' to 'AnsiString' (http://www.chiefdelphi.com/forums/showthread.php?t=75320)

ganjan 01-03-2009 11:34

Delphi 2009 Error: potential data loss from 'TCaption' to 'AnsiString'
 
Hi, Just starting learning Delphi. I am trying to learn how to send text strings over TCP. I made this really simple application that sends text strings from edit1 and the server application is suppose to add a new line in Memo1. Which it does, but only Chinese letters show up?!

ex:

127.0.0.1 Sends :
敨汬敯桔浥


I also get this Warning:

[DCC Warning] Client2.pas(38): W1058 Implicit string cast with potential data loss from 'TCaption' to 'AnsiString'

Client Code:

Code:

begin
  if ClientSocket1.Active = True then
  ClientSocket1.Socket.SendText(Edit1.Text);
end;

Server Code

Code:

procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  Memo1.Lines.Add(Socket.ReceiveText);
end;


radau 01-03-2009 13:07

Re: Delphi 2009 Error: potential data loss from 'TCaption' to 'AnsiString'
 
http://www.chiefdelphi.com/forums/sh...ad.php?t=29944

nathanww 01-03-2009 13:26

Re: Delphi 2009 Error: potential data loss from 'TCaption' to 'AnsiString'
 
Please read If you've come here for Delphi help...

I'm not saying that no one here can help you with this--but this forum is mostly about C,C++, and Labview, as applied to robotics.


All times are GMT -5. The time now is 01:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi