Наши преимущества

[help] lill help needs

6748222

Турист
Credits
0
hi! im beginer :mersi:
sory if i post in wrong forum =(

Question:

how to do this

if edit1.text is "lala" and edit3.text is 3
on button click edit2.text is "lala lala lala" if edit3.text is 4
then edit2.text is 'lala lala lala lala' etc..

Thanks!

and sory again if i post in wrong forum;(
 
Код:
procedure TForm1.Button1Click(Sender: TObject);
var i : integer;
begin
Edit2.Text:='';
for i:=1 to StrToInt(Edit3.Text) Do
  Edit2.Text := Edit2.Text + Edit1.Text+ ' ';
end;
 
альтернативная
Код:
procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
  s1, s2: string;
begin
  s1 := Edit1.Text;
  if s1 <> '' then begin
    s1 := s1 + ' ';
    s2 := '';
    for i := StrToIntDef(Edit3.Text, 0) do
      s2 := s2 + s1;
    Edit2.Text := s2;
  end;
end;
 
Верх