随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

问题来源: http://www.cnblogs.com/del/archive/2008/09/03/989467.html#1306651

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
const
  str1 = 'aaa';
  str2 = 'bbb';
var
  List: TStrings;
begin
  List := TStringList.Create;
  List.Add(str1 + '=123');
  List.Add(str2 + '=456');

  ShowMessage(List.Values['aaa']); {123}
  ShowMessage(List.Values['bbb']); {456}

  List.Free;
end;

end.

posted on 2008-09-02 22:59  万一  阅读(...)  评论(...编辑  收藏