DoneEx INI-File Manager Library  API Help

  AddKey

The AddKey function add new key into .INI file structure in memory

				
int AddKey(const long ini_file_num, 
             const long section_index, 
             const char* key_name, 
             const char* key_value
);				

Parameters
ini_file_num
[input] INI-file number which points to the data in memory structure. This number has to be saved from the return value of the previous call CreateINI or LoadINI functions.
section_index
[input] The zero-based index of the section that is enumerated from begin of INI-file.
key_name
[input] Pointer to a null-terminated string that specifies the new key name.
key_value
[input] Pointer to a null-terminated string that specifies the new key value.

Return Values
If succeed the AddKey function returns zero. Otherwise it returns value not equal to zero. To get extended error information, call GetLastErr.

Remark
The new key will be added to the latest line of indicated section. For add new comment the first simbol of key name has to be symbol ";".