var
vn_words, en_words: array [1..1000] of String; (???)
dotime, strings: String;
check_verbs, check_pharses: integer;
englishwo, vietnamwo: string;
Procedure Form1.OnCreate;
begin
Timer1.Enabled:=false;
Timer2.Enabled:=true;
listwords:=1;
AssignFile(In1,Application.Path+'\pharses.txt');
Reset(In1);
While not eof(In1) do
begin
readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
inc(listwords);
end;
CloseFile(In1);
Check_pharses:=listwords;
AssignFile(In1,Application.Path+'\verbs.txt');
Reset(In1);
While not eof(In1) do
begin
readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
inc(listwords);
end;
CloseFile(In1);
Check_verbs:=listwords-check_pharses;
AssignFile(In1,Application.Path+'\words.txt');
Reset(In1);
While not eof(In1) do
begin
readln(en_words[listwords], vn_words[listwords]); {I've shorten it a bit, but it should still be the same}
inc(listwords);
end;
CloseFile(In1);
end;
procedure Timer1.OnTimer;
begin
If txtvietnam.Text='' then exit;
if dotime=txtvietnam.Text then exit;
txtenglish.Text:='';
whereareweat:=1;
dotime:=txtvietnam.text;
strings:=txtvietnam.text;
for i:= 1 to 13 do
strings:=Replace(strings,vn_words[i],enwords[i] and ');
for i:=1 to 1000 do
strings:=Replace(strings,vn_words[i],enwords[i] and ');
txtvietnam.text:=strings;
end;
Timer2.OneTimer;
//identycznie jak Timer1, tylko trzeba zamienić miejscami English i Vietnam
Users browsing this forum: No registered users and 15 guests