如何在delphi7中转换此代码...
procedure Tform1.button1.click(sender: tobject);
var
LTZID: string;
begin
// Write each time zone ID on the console
for LTZID in TBundledTimeZone.KnownTimeZones(true) do
WriteLn(LTZID);
end;
谢谢...
答案 0 :(得分:4)
procedure Tform1.button1.click(sender: tobject);
var
i: Integer;
begin
// Write each time zone ID on the console
for i := Low(TBundledTimeZone.KnownTimeZones(true))
to High(TBundledTimeZone.KnownTimeZones(true)) do
WriteLn(TBundledTimeZone.KnownTimeZones(true)[i]);
end;
或者,有点优化:
procedure Tform1.button1.click(sender: tobject);
var
KnownTimeZones: TStringDynArray;
i: Integer;
begin
// Write each time zone ID on the console
KnownTimeZones := TBundledTimeZone.KnownTimeZones(true);
for i := Low(KnownTimeZones) to High(KnownTimeZones) do
WriteLn(KnownTimeZones[i]);
end;