このループを中止する最も一般的な方法を考えるために、非常に長いデータベース テーブルを処理する必要があります。主なコードシーケンスは次のようになります
procedure TForm.ProcessmyTable(Sender : TObject);
begin
.....
myTable.first;
repeat
ReadSingleRecordfromTable ( MyTable, aRecord) ;
ProcessMyRecord(aRecord) ;
MyTable.next;
until MYTable.EOF;
end;
unit .... ;
procedure ProcessMyRecord(aRecord : TMyDataRecord) ;
begin
// do not have user interface stuff here
// Application.Processmessages will not work here !!!
.... ( long running code sequence)
end;
タイマーを実行し、フラグ サポートとして var を使用してタイマーに基づいてループを中断することはできますが、これは本当にこの問題を解決する最も賢い方法ですか?