Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop

Status
Not open for further replies.

ozi403

Technical User
Apr 29, 2002
54
0
0
TR
How can I make a loop for getting value of each line of Memo?
 
Where Memo1 is type TMemo, and i is a line number.

Memo1.Lines
 
var i:integer;
begin
for i:=0 to memo1.lines.count -1 do
showmessage(memo1.lines);
end;

Aaron
 
Wouldn't this also work:

var s : string;
begin
for s in memo1.lines do
showmessage(s);
end;


Or is that too much of a flash back to the scripting days?


~
Give a man some fire, he will be warm for a day, Set a man on fire, he will be warm for the rest of his life.
 
Opieo, that syntax will only work in the newer versions of delphi (from 2005 - I think).

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Opieo, whosrdaddy,

That code certainly doesn't work in Delphi 6, but then the OP didn't state what version of Delphi they were using!

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top