1
Beginners / Program loop "runaway" while waiting on keyboard inputs
« Last post by new2thisagain395 on Today at 01:43:12 pm »I'm working on a small application that has a main program loop, that monitors the value stored in a string buffer and does things based on the values of what happens to be in that buffer at any given time.
The application uses the OnKeyPress event handler which monitors keypresses and stores either a single character, a string, or a password in the buffer (depending on what the user is doing).
The problem is, the main loop seems to get "hung up" and doesn't even get the application's window to the point where it's visible. I have to kill it using the System Monitor (on ubuntu).
The main loop is essentially:
If I remove the while loop, the stuff inside it works fine, although (as expected) only one time.
What is wrong in my thinking here? Thanks.
The application uses the OnKeyPress event handler which monitors keypresses and stores either a single character, a string, or a password in the buffer (depending on what the user is doing).
The problem is, the main loop seems to get "hung up" and doesn't even get the application's window to the point where it's visible. I have to kill it using the System Monitor (on ubuntu).
The main loop is essentially:
Code: [Select]
while (1) do begin
if (buffer = (something I care about) do_something
if (buffer = (something else that I care about) do_something_else
etc.
etc.
end;
If I remove the while loop, the stuff inside it works fine, although (as expected) only one time.
What is wrong in my thinking here? Thanks.