Home > Back-end >  For a constant reading code
For a constant reading code

Time:10-08


I want to do such a program, I have about 1000 phrases, there can be a custom document or DLL (preferably DLL), every second read a phrase, and the TEXT in the Edit1 do than pay, regardless of the results are displayed in the ListBox1 is equal, it is displayed in the Labe2, equal to a

The number of Labe1 is current ratio

CodePudding user response:

You can put the phrase in a text file, each row is a
Then use TStringList loading, use the timer to obtain
Var
LList: TStringList;//defined as global variable
LIdx: integer;//the current have been read to which a phrase
Lcount: integer;

Procedure tmrTime (Sender)
The begin
Inc (lIdx);
Lst1. Items. The Add (lList. Strings [lIdx]);
If lList. Strings [lIdx]=edit1. The Text then inc (lCount);
If lIdx=lList. Count - 1 then tmr1. Enabled:=false;//if you have finished reading all the records, stop the timer
end;
  • Related