H hnw1982 Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-28 #1 var str:tstringlist; begin 在str中有10个记录 我想删除直到str中剩下两个记录为止,应该怎么做 ,请指教.谢谢 end;
L liyinwei Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-28 #2 不明白! 知道有 10 个记录,那么留下你想要的2个,剩下的删除啊。
H hnw1982 Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #3 var str:tstringlist; i;integer; begin str:=tstringlist; try for i;=str.count-1 downto 0 do begin if str.count.3 then str.delete(i) else exit; end; finally str.free; end; end; 我是这样写的 可是出错,请大家指教.
var str:tstringlist; i;integer; begin str:=tstringlist; try for i;=str.count-1 downto 0 do begin if str.count.3 then str.delete(i) else exit; end; finally str.free; end; end; 我是这样写的 可是出错,请大家指教.
K kinneng Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #4 str:=tstringlist.create; try for i;=str.count-1 downto 0 do begin if str.count>=3 then str.delete(i) else break; end; finally str.free; end;
str:=tstringlist.create; try for i;=str.count-1 downto 0 do begin if str.count>=3 then str.delete(i) else break; end; finally str.free; end;
K kinneng Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-29 #5 这样写的代码虽然没报错,但没意思,因为最后等于什么也没干。