ChrisGSchultz
IS-IT--Management
Hi folks!
I'm trying to break out of a loop with a keypress, and have tried all sort of things, including the GetKeyState function included below, and a global hot key - but to no avail!
The Database I'm searching is very large (200,00 patients, > 1,000,000 images, and >> 1,000,000,000 result records), and whilst I simplify with a query to get the results, there is still a need to break out.
Here is the loop itself:
with ADOTable_Patients do begin
First;
ScanBreak := FALSE;
Application.ProcessMessages;
try
B_DataExtraction.Visible := FALSE;
CurrCursor := Screen.Cursor;
Screen.Cursor := crHourGlass; { hourglass cursor }
while not ADOTable_Patients.Eof do begin
if GetKeyState(VK_ESCAPE) and 128 = 128 then begin
ScanBreak := True;
Exit;
end; // if
aScanRecord := ExtractData; { this extracts images and results records}
next;
LMD_PFill.UserValue := ADOTable_Patients.RecNo; {a simple meter}
end; // while not eof
finally
B_DataExtraction.Visible := TRUE;
Screen.Cursor := CurrCursor; { restore cursor }
end;
end; // with ADOTable_Patients
Any suggestions greatly appreciated!
and BTW - Happy New Year to all!
Chris ;-)
I'm trying to break out of a loop with a keypress, and have tried all sort of things, including the GetKeyState function included below, and a global hot key - but to no avail!
The Database I'm searching is very large (200,00 patients, > 1,000,000 images, and >> 1,000,000,000 result records), and whilst I simplify with a query to get the results, there is still a need to break out.
Here is the loop itself:
with ADOTable_Patients do begin
First;
ScanBreak := FALSE;
Application.ProcessMessages;
try
B_DataExtraction.Visible := FALSE;
CurrCursor := Screen.Cursor;
Screen.Cursor := crHourGlass; { hourglass cursor }
while not ADOTable_Patients.Eof do begin
if GetKeyState(VK_ESCAPE) and 128 = 128 then begin
ScanBreak := True;
Exit;
end; // if
aScanRecord := ExtractData; { this extracts images and results records}
next;
LMD_PFill.UserValue := ADOTable_Patients.RecNo; {a simple meter}
end; // while not eof
finally
B_DataExtraction.Visible := TRUE;
Screen.Cursor := CurrCursor; { restore cursor }
end;
end; // with ADOTable_Patients
Any suggestions greatly appreciated!
and BTW - Happy New Year to all!
Chris ;-)