A
A
Alex Alex2015-09-30 20:10:51
Delphi
Alex Alex, 2015-09-30 20:10:51

How to remove hangup when saving larger Delphi txt file?

Information from the site is parsed into the memo, sometimes 10-20k lines, and when you click on save, the software freezes, how to avoid it ?!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
patch1, 2015-09-30
@patch1

I am a high-level Psychic, my references say that you are parsing the Memo from the main thread, but you need to create a child thread that will parse whatever you want in the Memo.
Link , similarly with writing to a txt file, make a record in a separate stream, at the end let the message "Record completed" pop up, or you can implement a progress bar that shows the current progress of writing to a file. Everything is in your power, young man.

A
Anton Fedoryan, 2015-10-01
@AnnTHony

Write in those. Google support to get you unbanned. Application.ProcessMessages
Method

M
Mercury13, 2015-10-01
@Mercury13

There are many options, and yes, some will do.
1. Simple and dirty. Periodically do Application.ProcessMessages. Make sure that none of the buttons work during operation.
2. Better for the finished product. Set up the flow. Attention, the network in the main thread is, in principle, not a good thing, if it is there - let's go write the second one!
3. Optimize the algorithm.
4. Get rid of left redraws. Google post WM_SETREDRAW. Don't forget at the end of Invalidate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question