while i<3999 do
  BEGIN
    if (kit1[i]<>#13) then
      temp:=temp+kit1[i]
    else
    begin
      Series1.AddXY(cc,strtofloat(temp), '', clTeeColor );
      i:=i+1;
      cc:=cc+1;
      temp:='';
    end;
    i:=i+1;
    if cc>400 then break;
  END;这是我的方法。。各位有什么更快的方法吗?

解决方案 »

  1.   

    var sl :TStringList;sl := TStringList.Create;
    sl.Text := PChar(@kit1);
    for i:=0 to sl.Count-1 do
      Series1.AddXY(cc,strtofloat(sl[i]), '', clTeeColor );
    sl.Free;
    //未测试,但应该没有问题
      

  2.   

    windindance(风舞轻扬) 可以,但是我测试过,速度和我的差不多。
    请问哪位还有比较好的方法没有;/
      

  3.   

    一定要这么快吗?
    这样试试:
    var
      temp :double;
    temp := 0;
    while i<3999 do
      BEGIN
       case kit1[i] of
       '-' : temp := -temp;
       '0' ..'9': temp := temp * 10 + temp;
       '.' : ...
       else ...
      //这儿直接计算temp的值,具体算法我就不写了
       end;    if (...) then
        begin
          Series1.AddXY(cc,temp, '', clTeeColor );
          i:=i+1;
          cc:=cc+1;
          temp:='';
        end;
        i:=i+1;
        if cc>400 then break;
      END;这样还是不行的话,恐怕只能用汇编了