一个文本中有若干行怎么计算出它的行数啊?谢谢!

解决方案 »

  1.   

    如果是TMemo控件, 则 控件名.Lines.Count 就是文本的行数
      

  2.   

    假如有这样一个文本文件
    Ellipse 200 310 320 250 210  
    Line 126 210 235 301  
    Rectangle 230 210 320 350 
    我要读出它的每行,且画出相应的图形item[1]是每行第一个字符串,
    if item[1]='Line' then
            begin
             canvas.moveto(strtoint(item[2]),strtoint(item[3]));
             canvas.lineto(strtoint(item[4]),strtoint(item[5]));
            end;
          if item[1]='Rectangle' then
            begin
             canvas.Rectangle(strtoint(item[2]),strtoint(item[3]),strtoint(item[4]),strtoint(item[5]));
            end;
          if item[1]='Ellipse' then
            begin
            canvas.Ellipse(strtoint(item[2]),strtoint(item[3]),strtoint(item[4]),strtoint(item[5]));
            end;
    这样循环只能画到第一个图形,我想加一个FOR循环,行数怎么求得啊