From RAD Studio API Documentation
Jump to: navigation, search



TMemIniFile = class(TCustomIniFile)


class PASCALIMPLEMENTATION TMemIniFile : public TCustomIniFile


Type Visibility Source Unit Parent
class public
System.IniFiles System.IniFiles


TMemIniFile enables buffered storage and retrieval of application-specific information and settings in an INI file.

Use TMemIniFile to store and retrieve application-specific information and settings in a Windows INI file. An INI file stores information in logical groupings, called "sections." Within each section, actual data values are stored in named keys. Keys take the form:


TMemIniFile buffers all changes to the INI file. The INI file is read once, when the object is first created. Data from the INI file is stored in nested string lists. Each section in the INI file occupies one element in the top-most string list, and each element in this may itself contain a string list. Each element in each of the contained string list represents a key within the section. After the data is read, any changes to the data are stored in memory. To write the data from memory back to the associated INI file, call the UpdateFile method.

Note: If the destructor is called before calling the UpdateFile method, the changes will not be saved to the INI file. To avoid this loss of information, use the AutoSave property. If you set the AutoSave property to True, when the destructor is called, the changes of TMemIniFile are automatically saved to the associated INI file.

All TMemIniFile methods to read, write, and erase sections, keys, and values operate on the in-memory copy of the INI file.

See Also

Code Examples