Hope everyone is doing great.
I just have one question , in Delphi programming...
I've a Memo that loads me a file .txt , and it contains big lines , like 50,000Lines....
SO I want to split thes lines to 5000line then loading them into a new Memo.
for example for the first split , it will split 5000lines on a new file text then loading it on a new memo , after the load (deleting the file of 5000) , and of course it will be 45000 for the big LINES.
the second split it will split 5000 from the 45,000 , it will be 40,000 on the big lines , 5000on the new Lines (file text) .
THE REASON why i want to split the lines on file text then loading it , because the program isn't answering (not responding) when i split the files into the memo .
procedure TForm1.Button1Click(Sender: TObject);
var count,i ,X,m:integer;
begin
Memo2.Clear;
Label1.Caption:=IntToStr(Memo1.Lines.Count) ;
if Memo1.Lines.Count > 5000 then
X:=5000
else X:= Memo1.Lines.Count ;
for count:=0 to x do
begin
Memo2.lines.add(Memo1.lines.Strings[0]);
Memo1.Lines.Delete(0);
Memo2.Text:=Trim(Memo2.text);
end;
end;
This is the code i'm using to split small Lines to small other lines ...
In a Memo , but when you have 1 million of lines , the program will stop answering.
i added the trim(memo2.text) ; To delete the blank line at the End.
So how i can do the spliting of Lines ,not of File SIZE(because it will destroy lines) ... how i can do the split of big lines like i said to file text then loading it and deleting it , then when i re-click a button it will do the same operation with the others lines ....
I know that we must using TThread class , but i don't know how to make it happen with my code... Thank's!
Thank you.
See Question&Answers more detail:
os