为什么LongMonthNames[X]
单独(没有名称空间前缀)在 Delphi XE7 中不起作用,而在 Delphi XE2 中起作用?
program LongMonthNames_Test;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils;
begin
try
// Works in both Delphi XE2 and Delphi XE7:
Writeln(System.SysUtils.FormatSettings.LongMonthNames[12]);
// Works only in Delphi XE2, does NOT work in Delphi XE7:
// ("not work" obviously means does not compile because of errors in the source code)
Writeln(LongMonthNames[12]);
Readln;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.