Solved

How to detect a key pression inside a while loop

Posted on 1998-11-26
1
136 Views
Last Modified: 2010-04-04
Hi all..

I have a menu option that reads the 64K memory of a circuit connected to the serial port. When that option is chosen, a function that reads the memory is called. That function has a while loop that reads 4096 memory blocks at a time until it has read 64 K. The problem is that if I want to cancel the read operation, for example, by pressing F7, the program doesn't respond to keypresses. Is there in Delphi 3.0 something similar to Pascal ReadKey and Keypressed? or do you have any other suggestion? onKeyPress event of the form containing the menu doesn't work until the memory was completely read, that is, when the readmemory function finishes.

Thanks a lot for help in advance,
Jaime
0
Comment
Question by:skel
1 Comment
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1348022
In the loop reading the memoery do this:

Application.ProcessMessages.

Cheers,

Raymond.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now