[help] lill help needs

6748222

New member
Joined
Apr 1, 2009
Messages
2
Reaction score
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;(
 

AT4RE

Member
Joined
Jan 8, 2009
Messages
25
Reaction score
54
Code:
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;
 

6748222

New member
Joined
Apr 1, 2009
Messages
2
Reaction score
0
THANK YOU !!
 
Last edited by a moderator:

aa.

Member
Joined
Aug 26, 2008
Messages
7
Reaction score
0
альтернативная
Code:
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;
 
Top