Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Rad sa TMemo komponentom

[es] :: Pascal / Delphi / Kylix :: Rad sa TMemo komponentom

[ Pregleda: 1615 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

reikonija
Faks<lll>
Visegrad

Član broj: 213271
Poruke: 121
*.teol.net.



+4 Profil

icon Rad sa TMemo komponentom21.09.2011. u 19:04 - pre 153 meseci
Zanima me kako da izlistam sve brojeve od npr. 1 do 100 ali ne ovako :
1,
2,
3,
4,
5,
vec kao 1,2,3,4,5,6 u Memo komponenti , znam preko for petlje ali su jedan ispod drugog.
To je sve...
 
Odgovor na temu

salaczr

Član broj: 160654
Poruke: 103
*.dynamic.isp.telekom.rs.



+5 Profil

icon Re: Rad sa TMemo komponentom21.09.2011. u 19:11 - pre 153 meseci
Kreriaj neki string u petlji
Code:

nekistring := '';
for i := 1 to 100 do
  nekistring := nekistring + IntToStr(i);

a zatim ga upisi u TMemo
Code:

nekimemo.lines.add(nekistring);

 
Odgovor na temu

reikonija
Faks<lll>
Visegrad

Član broj: 213271
Poruke: 121
*.teol.net.



+4 Profil

icon Re: Rad sa TMemo komponentom21.09.2011. u 19:14 - pre 153 meseci
Hvala na odgovoru , nisam dugo raio u delphiju , zapao u Pythonu :)
Resio sam:

procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to 10 do
memo1.Text:=memo1.text + inttostr(i)+',';
end;
end.


Hvala puno , na odgovoru :)
 
Odgovor na temu

X Files
Vladimir Stefanovic
Pozarevac

SuperModerator
Član broj: 15100
Poruke: 4902
*.dynamic.sbb.rs.

Jabber: xfiles@elitesecurity.org


+638 Profil

icon Re: Rad sa TMemo komponentom21.09.2011. u 19:50 - pre 153 meseci
Možda ne bi bilo loše pročitati ovo:
http://objectmix.com/delphi/40...tter-solution.html#post1511678
Citat:

> Memo1.Text := Memo1.Text + Temptext;
> Memo1.SelStart := Length(Memo1.Text);

That is very inefficient. You are copying the entire TMemo contents to a
temporary String, then replacing the entire TMemo contents with a new
string, then copying the entire contents back to another temporary String to
query its length. The more content the TMemo has, the longer those
operations will take, and the more memory they will consume.

Use the SelText property instead when appending new text, and use the
GetTextLen() method to retreive the current length, ie:

Code:

 Memo1.SelStart := Memo1.GetTextLen;
 Memo1.SelLength := 0;
 Memo1.SelText := Temptext;
 Memo1.SelStart := Memo1.GetTextLen;
 SendMessage(Memo1.Handle, EM_SCROLLCARET, 0, 0);

Gambit

 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: Rad sa TMemo komponentom

[ Pregleda: 1615 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.