In D7 lässt sich das Problem sehr elegant lösen:
Delphi-Quellcode:
type
TMainForm =
class(TForm)
Button: TButton;
HexEdit: TEdit;
ValueEdit: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ButtonClick(Sender: TObject);
private
s: TStrings;
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
begin
s := TStringList.Create;
s.NameValueSeparator := '
:';
s.LoadFromFile('
c:\daten\dp\v1.txt');
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
s.Free;
end;
procedure TMainForm.ButtonClick(Sender: TObject);
begin
ValueEdit.Text := s.Values[HexEdit.Text];
end;
Grüße vom marabu