谢谢各位的观注!!
我的程序(多次)执行这句。
Result:= NextFindNext(fNextText, '<', fNextPos, tag1) and NextFindNext(fNextText, '>', tag1, tag2);
内存狂增,且释放不了,请问名位大侠这应该怎么处理???
function NextFindNext(const Nexttext:string; ch:char; startfrom:Integer; var pos:Integer):Boolean;
begin
pos:= startfrom;
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
Result:= (Nexttext[pos]=ch);
end;
我的程序(多次)执行这句。
Result:= NextFindNext(fNextText, '<', fNextPos, tag1) and NextFindNext(fNextText, '>', tag1, tag2);
内存狂增,且释放不了,请问名位大侠这应该怎么处理???
function NextFindNext(const Nexttext:string; ch:char; startfrom:Integer; var pos:Integer):Boolean;
begin
pos:= startfrom;
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
Result:= (Nexttext[pos]=ch);
end;
解决方案 »
- 关于控件的显示
- 小游戏盒子(客户端)用什么软件开发的!
- 为什么我的程序占用的内存随时间越来越大???
- 有没有既懂DELPHI又懂C++的兄弟啊?来帮忙看看这段代码!关于读取二进制图片的!
- initialization Coinitialize(nil);finalization CoUninitialize;这两句话在DLL写在什么地方?
- ASTA3怎么使用呢?
- 误删了一个.dcu文件,pas和dfm都在,还能找回吗?我的form打不开了
- 难道都没有人回答了吗???(分数不够再加)大家路过就进去年看一下吧
- 我想取得DBGrid被选中的一行的某一列的值,该怎么处理?
- 求delphi高手成长历程
- winsock:如何得到IP地址? 100分送上!
- 高手请进,我一个问题请教诸位老大!!!!!,
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
给去掉,内存可以释放掉?
var s:string;
begin
s:=copy(nexttext,startfrom,length(nexttext)-startfrom+1);
result:=( pos(ch,s)=0);
end;
单步调试不报错,
如果把这句
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
给去掉,内存可以释放掉
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
Result:= (Nexttext[pos]=ch);
// 因为有 pos这个条件限制....是不是你这个 Nexttext函数的问题??
死循环看起来不像.
while (pos<=Length(Nexttext)) and (Nexttext[pos]<>ch) do Inc(pos);
Result:= (Nexttext[pos]=ch);
// 因为有 pos这个条件限制....是不是你这个 Nexttext函数的问题??
Nexttext不是函数,是一个Nexttext:string
其实看你的程序应该不用var修饰。