Delphi警告 - W1002符号'FileSetDate'特定于一个平台
问题描述:
当我在Delphi 2006下编译我的应用程序时,我得到以下警告
[Pascal Warning] - W1002符号'FileSetDate'是一个平台的特定
When I compile my application under Delphi 2006 I get the following warning [Pascal Warning]- W1002 Symbol 'FileSetDate' is specific to a platform
我要做什么来压制这个警告?
What must I do to suppress this warning?
代码
MyLastError:= FileSetDate( Files[ i ].Handle, DateTimeToFileDate( arcDate ) );
答
尽管DR的答案解决了警告,不正确的解决方案。
Although the answer of DR solves the warning, it is not the correct solution.
您应该使用平台独立的FileSetDate版本:
You should use the platform independent version of FileSetDate:
function FileSetDate(const FileName: string; Age: Integer): Integer; overload;
同样在SysUtils中。
Also in SysUtils.