.
.
public
zfilepathlist:TStrings;
.
.
procedure TFrm_result.Button1Click(Sender: TObject);
var
begin
zfilepathlist.Create;
SearchALLFile().....自定义的function
end;function TFrm_result.SearchALLFile(.....自定义的function
....
zfilepathlist.Add(tstr); <---------------总是在这里出错!
....错误提示:
project1.exe raised exception class EAccessViolation with message 'Access violation at address 0047498d in module 'Project1.exe'.read of address 00000000'我是初学者,对TStrings型变量不太了解,请各为前辈指点!
.
public
zfilepathlist:TStrings;
.
.
procedure TFrm_result.Button1Click(Sender: TObject);
var
begin
zfilepathlist.Create;
SearchALLFile().....自定义的function
end;function TFrm_result.SearchALLFile(.....自定义的function
....
zfilepathlist.Add(tstr); <---------------总是在这里出错!
....错误提示:
project1.exe raised exception class EAccessViolation with message 'Access violation at address 0047498d in module 'Project1.exe'.read of address 00000000'我是初学者,对TStrings型变量不太了解,请各为前辈指点!
zfilepathlist:=TStrings.Create;
首先要创建实例
中将我查找到的文件名加入到zfilepathlist中,也就是说在窗体zfilepathlist声明后,在第一次创建实例后,就是累加字符串操作了。就是这个目的!
Zpath := TstringList.Create;多谢大家的帮忙!