Вот я исправил, на мемо больше не ругается, но когда нажимаю перевод, вылетает сообщение об ошибке:
"Project Projectl.exe raised exception class EAccessViolation with message 'Access violation at address 00414988 in module 'Projectl.exe'. Read of address 00000004' Process stopped. Use Step or Run to continue."
"Access violation at address 00414988 in module 'Project1.exe'. Read of address 00000004."
И в итоге ни чего не переводит ...
procedure TForm1.replace_word (next_word: string); var next_word_rus: string; ER :TStrings;
begin
next_word_rus:=ER.Values[next_word]; if next_word_rus='' then next_word_rus:=next_word; Memo2.Lines.Add(next_word_rus);
end;
procedure TForm1.Button1Click(Sender: TObject);
var s, next_word: string; i: byte; currLine: integer; ER :TStrings;
begin ER:=TStringList.Create; ER.LoadFromFile('voc.txt'); For currLine := 0 To Pred(memo1.Lines.Count) Do Begin s := memo1.Lines.Strings[currLine]; i := 1; next_word := ''; while i <= length(s) do begin if upcase(s[i]) in ['A'..'Z'] then begin next_word := next_word + s[i]; inc(i) end else begin if next_word <> '' then replace_word(next_word); Memo2.Lines.Add(s[i]); next_word := ''; inc(i); end; end;
if next_word <> '' then replace_word(next_word); end; er.free end;