inc(foundstr,length(foundstr));foundstr在执行这条语句之前为"want to" 在执行之后就是"",这是为什么?inc()对它进行了什么操作?inc()不是对参数进行加值的操作吗!
解决方案 »
- 请高手指点:怎样开发类似网络(如联众,QQ等)纸牌游戏的记牌器之类的程序
- 如何使MDIChild中的一个窗口设成激活状态???
- 救命啊 如何把DBGRID的数据导入Xstringgrid中啊
- win api 函数的使用在线等
- delphi 怎样处理日期货币数据字段,用sql
- 要應聘delphi程序員的請進
- 救急,快失业了,一个Button控件!!!!
- 谁能在代码中添加记录集中的部分字段和增加新的用来计算的字段(200分单独给)
- 谁有Pascal语言的文件压缩和解压缩源程序,LZW,HUF等都可以,请帮忙E-Mail给我一个([email protected])
- Delphi能不能开发WindowsCE应用?
- 超长SQL语句,高手进来看,在线等待
- 超长SQL语句,高手进来看,在线等待
不能是string
try
while retval=0 do
begin
fname:=searchrec.Name;
memmapfile:=tmemmapfile.create(fname,fmopenread,0,true);
try
findstring:=edtsearchstring.text;
wordcount:=0;
foundstr:=strpos(pchar(memmapfile.data),pchar(findstring));
if foundstr<>nil then
begin
repeat
inc(wordcount);
showmessage('start foundstr:' + foundstr);
inc(foundstr,length(foundstr));
showmessage('end foundstr:' + foundstr);
foundstr:=strpos(pchar(foundstr),pchar(findstring));
until foundstr=nil;
lbfilesfound.items.add(searchrec.name+' . '+inttostrwordcount));
end;
retval:=findnext(searchrec);