1
If I copy each character individually from Edit and give a line break with #13#10, I use a code like this, but depending on the program is very full of variables
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,d,e:string;
begin
a:=copy(Edit1.Text,1,1)+ #13#10;
b:=copy(Edit1.Text,2,1)+ #13#10;
c:=copy(Edit1.Text,3,1)+ #13#10;
d:=copy(Edit1.Text,4,1)+ #13#10;
e:=copy(Edit1.Text,5,1)+ #13#10;
memo1.Lines.Add(concat (a + B + C + d +e ));
end;
There would be no simpler way to do it even by wiping the above code using a for loop, while or otherwise, to use only one variable?
kind of:
procedure TForm1.Button2Click(Sender: TObject);
var
a:string;
i:integer ;
begin
for i:=0 to Length(Edit1.text) do
a:=(copy(Edit1.Text,i,1)+ #13#10);
memo1.Lines.Add(a);
end;
I thank David , but I’m in trouble I need to make the loop with Copy even, more or less in that style I made up with the for, with Wile, if you have conditions because the program is almost ready, most I know the amount of strings, so I’m just having to dry the code, thanks again for the help, if you have any other tips I appreciate
– user101552
@acs, try to read the code I posted for example, to apply to yours, has no big changes, basically a new vector. If you can’t tell me I’ll apply the solution to your context.
– David
Greetings David, really, it’s really nice, thank you
– user101552
Could you mark the question as answered? When in doubt, visit [tour] to find out how to do this. Thank you.
– David
nothing, yes no problem, already answered, I just did not find the mode in the link of the tour above that you passed, as soon as I find I mark it, hug
– user101552