Thats the problem... The Memo always for start has a blank line. Before I start to add lines in it.. It has one blank line
-----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Nesler, Thomas J Enviado el: lunes, 27 de febrero de 2006 01:44 Para: Borland's Delphi Discussion List Asunto: RE: TMemo has always one blank line Hello! Assuming that your memo component does not have a blank line in it before you add your lines, you may be having a problem with the input text file. You probably should add a showmessage to see what the program is putting into the file. Like this: Var S : String; Begin .... for i:=0 to length(t^.Data1) - 1 do Begin S := Copy(t^.Data1[i], 0, length(t^.Data1[i]) - 2) Showmessage(S); Memo1.lines.Add(S); end; .... My guess is that the last line in your input is a carriage return, causing the blank line. Good Luck! Tom Nesler -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ernesto Cisneros Sánchez Sent: Monday, February 27, 2006 6:37 AM To: [email protected] Cc: [email protected] Subject: TMemo has always one blank line TMemo has always one blank line Hi list i'm writing 'cos i need to save a memo content to a txt file. I 'll do as follow: memo1.Lines.Clear; for i:=0 to length(t^.Data1) - 1 do Memo1.lines.Add(Copy(t^.Data1[i], 0, length(t^.Data1[i]) - 2)); i put the -2 in the copy function 'cos I don't want the last 2 character of the record. The thing is that this actually add in the memo what i want but leave a blank line at the end of the memo. example. the memo has: REF 2345 REF 8789 REF 0908 <----- here is the last blank line when i copy the content to the txt file with: writeLn(F, query1.fieldbyname('data1').asstring); instead of write only the 3 lines, it will write 4 with the last empty any idea on this?? _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

