问题来源: 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.