For loop for reverse words in an Edit
delphi, lazarus
Solution
You could try to use the function `ReverseString();` that is contained on StrUtils. So, first of all add `StrUtils` in your uses clause. Then put this code instead of that for loop:
begin
a:=Edit1.text;
Edit2.Text:=ReverseString(a);
end;
It is the same as yours, but this way is easier. Also, if you want the length of the string just write this code:
Edit3.Text:=IntToStr(length(your_edit.text));
Of course, instead of `your_edit`, type the correct name of the Edit.
Problem
This is the code I am using at the moment: ``` procedure TForm1.Button1Click(Sender: TObject); var a:string; i:smallint; begin a:=Edit1.text; for i:= 1 downto length(Edit1.Text) do begin Edit2.Text:= {last letter}; end; ``` I'd like that the program takes the last letter of the word in `Edit1.Text` and puts it on `Edit2.Text`. What could I do? If you need here you can see a picture of the program: