[PR] memo...

0

wie moze ktos, jak co drugi znak wstawic jakas wartosc w komponencie TMemo?

0
procedure TForm1.Button1Click(Sender: TObject);
var
 S: String;
 n: Integer;
 Znak: String;
begin
 Znak:='#2#';
 S:=Memo1.Lines.Text;
 for n:=Length(S) downto 2 do
  begin
   if ((n-1) mod 2)=0 then Insert(Znak,S,n);
  end;
 Memo1.Lines.Text:=S;
end;
0

Ja to widze tak

procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
s,a : string;
b:boolean;
begin
b := false;
  for i := 1 to length(memo1.text) do
  begin
    a := memo1.Text;
    if b then
    begin
      s := s + a[i]+'a';
      memo2.Text := s;
      b := false;
    end else
    begin
      s := s + a[i];
      b := true;
    end;
  end;
end;
0

Koledzy zle postepujecie
powinniscie go nakierowac a nie dawac gotowca
oto link
http://4programmers.net/view.html?id=16
ale nastepnym razem sam szukaj

1 użytkowników online, w tym zalogowanych: 0, gości: 1