编译cxLibrary如下函数出错:
-
function GetEraYearOffset(const Name: string): Integer;
-
var
-
I: Integer;
-
begin
-
Result := 0;
-
for I := Low(EraNames) to High(EraNames) do
-
begin
-
if EraNames[I] = '' then
-
Break;
-
if AnsiStrPos(PChar(EraNames[I]), PChar(Name)) <> nil then
-
begin
-
Result := EraYearOffsets[I];
-
Exit;
-
end;
-
end;
-
end;
是因为SysUtils做了修改,对应修改如下:
-
function GetEraYearOffset(const Name: string): Integer;
-
var
-
I: Integer;
-
begin
-
Result := 0;
-
for I := Low(FormatSettings.EraInfo) to High(FormatSettings.EraInfo) do
-
begin
-
if FormatSettings.EraInfo[I].EraName = '' then
-
Break;
-
if AnsiStrPos(PChar(FormatSettings.EraInfo[I].EraName), PChar(Name)) <> nil
-
then
-
begin
-
Result := FormatSettings.EraInfo[I].EraOffset;
-
Exit;
-
end;
-
end;
-
end;
还有一处:
-
if AnsiPos('e', AFormat.ShortDateFormat) > 0 then
-
AEraYearOffset := EraYearOffsets[1];
对应修改为:
-
if AnsiPos('e', AFormat.ShortDateFormat) > 0 then
-
AEraYearOffset := FormatSettings.EraInfo[1].EraOffset;
请发表评论