RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomIniFile.ReadString Method

Retrieves a string value from an ini file.

Pascal
function ReadString(const Section: string; const Ident: string; const Default: string): string; virtual; abstract;
C++
virtual __fastcall AnsiString ReadString(const AnsiString Section, const AnsiString Ident, const AnsiString Default) = 0;

Call ReadString to read a string value from a .ini file. Section identifies the section in the file that contains the desired key. Ident is the name of the key from which to retrieve the value. Default is the string value to return if the: 

Section does not exist. 

Key does not exist. 

Data value for the key is not assigned.

Note: On Windows, if the string in the .ini file is surrounded by quotation marks, the return value has those marks stripped away. On Linux, the quotation marks are preserved.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!