简单的变量查看问题?(30分)

  • 主题发起人 dafuwengqing
  • 开始时间
D

dafuwengqing

Unregistered / Unconfirmed
GUEST, unregistred user!
大虾们:
我写了个函数,在调试时查看check1变量出现
check1: Variable 'check1' inaccessible here due to optimization
程序如下:
function check(from:string;too:string;Cc:string;subject:string;content:string):Integer;
var
readfile:Textfile;
s:string;
check1,check2,check3,check4:integer;

begin
assignfile(readfile,'topic.eml');
reset(readfile);
repeat
readln(readfile,s);
until((Pos('From',s)>0) or (eof(readfile)));
if(Pos('From',s)=0) then
result:=0;
check1:=compareText(s,from);
close(readfile);
end
 
什么意思,是让大家学习吗?
 
你没有任何地方引用check1,他自然就被优化掉了,运行时你当然看不到了。
 
直接用showmessage(check1)得了..

就象tseug所说的..
Variable 'check1' inaccessible here due to optimization <<== 这句已经说得很明白了 -_-
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
844
import
I
S
回复
0
查看
847
SUNSTONE的Delphi笔记
S
顶部