DELPHI中对应C#中的key-value的类型:KeyValuePair

C#中的定义:

Dictionary<int, string> device_Type = new Dictionary<int, string>();

foreach (KeyValuePair<int, string> kvp in device_Type)

Delphi中可以用:

var sl :TStringList;

sl := TStringList.Create;

sl.Values['aa'] := '123';

也可以用数组:

a : array of string;
begin
  setlength(a, 10);
  a[0] := 'abc';
  a[1] := 'cdf';
  ...
  a[9] := 'xxx';
  ....

猜你喜欢

转载自blog.csdn.net/xyzhan/article/details/89139269