Re: Removing from INI file
- From: erewhon@xxxxxxxxxx (J French)
- Date: Mon, 19 Sep 2005 07:45:59 +0000 (UTC)
On Mon, 19 Sep 2005 00:25:40 GMT, "Brian" <not@xxxxxxxxx> wrote:
>Hi
>
>How do you remove and entry from a INI when you only know the
>value and not the key?
>I'm trying to say remove the line KEY=VALUE where VALUE = X
This is a bit dangerous as you might have more than one entry
containing the Value, but I suppose you are only going to use it on
your own Files
The simplest method is probably to get the data into a TStringList
Here is a heavy hint :-
Uses IniFiles;
procedure TForm1.Button1Click(Sender: TObject);
Var
MI :TMemIniFile;
begin
MI := TMemIniFile.Create( 'c:\windows\win.ini' );
MI.GetStrings( ListBox1.Items );
MI.Free;
ShowMessage( ListBox1.Items.Text );
end;
.
- References:
- Removing from INI file
- From: Brian
- Removing from INI file
- Prev by Date: Re: Removing from INI file
- Next by Date: Re: Run Last
- Previous by thread: Re: Removing from INI file
- Next by thread: Re: boeh boeh, font test, boeh boeh. =D
- Index(es):