只是为了好奇:为什么这段代码给出AV而不是抛出异常? procedure TForm1.Button1Click(Sender: TObject);var fs: TFormatSettings;begin strtodate('2011-01-01', fs);end; 您的代码引发异常,因为fs未初始化. uses Sys
procedure TForm1.Button1Click(Sender: TObject); var fs: TFormatSettings; begin strtodate('2011-01-01', fs); end;您的代码引发异常,因为fs未初始化.
uses SysUtis, Windows; procedure TForm1.Button1Click(Sender: TObject); var fs: TFormatSettings; begin GetLocaleFormatSettings(GetSystemDefaultLCID, fs); // what is your short-date format? strtodate('2011-01-01', fs); end;