2,496
社区成员
发帖
与我相关
我的任务
分享
type
TCityInformation = packed record
ID : Integer;
Name: string;
Code: Integer;
TelCode: Integer;
end;
gtCityRange = 0..2;
const
gcCitys: array[gtCityRange] of TCityInformation = (
(ID:40000; Name:'朔州'; Code:1406; TelCode:349),
(ID:40001; Name:'石家庄'; Code:1301; TelCode:311),
(ID:40002; Name:'保定'; Code:1306; TelCode:312));
var
sl: TStringList;
i: Integer; //可能是枚举类型
begin
sl := TStringList.Create;
for i := Low(gtCityRange) to High(gtCityRange) do
begin
sl.Add(Format('%d,%s,%d,%d',[gcCitys[i].Id, gcCitys[i].Name, gcCitys[i].Code, gcCitys[i].TelCode ]));
end;
sl.SaveToFile('temp.txt');
sl.Free;
end;