Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 8th, 2004, 12:03 PM
Xian Xian is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 24 Xian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
send&receive text with tmemo

hi!
I'm trying to make a procedure that can send&receive text messages using a tmemo control and client/server sockets!!
when i send a message I press the enter key:

Procedure TfrmMain.memLogKeyPress(Sender: TObject; var key:char);
var
SendString : String;
ResultString : String;

begin
OKDone := False;
FirstRowDone := False;
if Key = #13 then
begin

{Sends Last Line}
SendString := memLog.Lines[memLog.Lines.Count-1];
Client1.Write(SendString);
ResultString := Client1.ReadLn;
memLog.Lines.Add(ResultString);
end; {Send Commands}
end;

but it doesn't work because when I press the enter key, nothing happens!!
can you help me please?? thank you!!@

Christian

Reply With Quote
  #2  
Old October 8th, 2004, 02:06 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Click here for more information.
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,713 Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 21 m 11 sec
Reputation Power: 1179
Most likely it is something to do with the Socket code. This code works fine:
Code:
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
var
	SendString : string;
begin
	if Key = #13 then
	begin
		SendString := Memo1.Lines[Memo1.Lines.Count - 1];
		ShowMessage(SendString);
	end;
end;

When I do this, the message shows up which proves that the code is being triggered when I hit the enter key. I'm pretty certain your problem is elsewhere, but without seeing your code, I cannot tell you where it is.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by Keath and KevinADC, superior perl programmers of the month

Reply With Quote
  #3  
Old October 11th, 2004, 06:47 AM
Xian Xian is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 24 Xian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried your procedure but is not enough!!
I send you my code(that's also yours!!), please help me!!
Another question:this program is able to send text strings to other client connected, is possible to send these strings (just in a time) to all the client connected at the moment using the same socket??
Thank You!!

Christian
Attached Files
File Type: zip Forwarder.zip (9.8 KB, 249 views)

Reply With Quote
  #4  
Old November 3rd, 2004, 02:47 PM
Dinky Dinky is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 Dinky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via MSN to Dinky
??????

Xian are you trying to make a chat system? can you give me more information on wot you are wanting??? better still add me on msn so we can chat djgalaxy2k@hotmail.com cheers

Reply With Quote
  #5  
Old November 27th, 2004, 09:21 PM
thiswasgood thiswasgood is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 thiswasgood User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
memLog-> OnKeyPress

Uncalled --->procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);


check ur OnKeyPRess for the memLog ok ... it is blank..

:-)


Quote:
Originally Posted by Xian
I tried your procedure but is not enough!!
I send you my code(that's also yours!!), please help me!!
Another question:this program is able to send text strings to other client connected, is possible to send these strings (just in a time) to all the client connected at the moment using the same socket??
Thank You!!

Christian

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > send&receive text with tmemo


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT