Ini_CopySection
- Updated2023-02-21
- 2 minute(s) read
int Ini_CopySection (IniText source, const char sectionToCopy[], IniText destination, int overwriteDuplicateSections);
Purpose
Copies a section of tag-value pairs from one in-memory list to another.
If there already is a section of the same name in the destination list, you can overwrite the section or merge the two sections. If you merge the two sections, items with the same tags are overwritten unless you have disabled duplicate checking using the Ini_SetDuplicateChecking function.
Parameters
| Input | ||
| Name | Type | Description |
| source | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs. This list will be copied into the list specified by the destination parameter. |
| sectionToCopy | const char [] | This parameter specifies the name of the source list section to merge into the destination list. Pass 0 to merge all of the sections in the source list into the destination list. |
| destination | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs. The contents of the source list will be copied into this list. |
| overwriteDuplicateSections | int | This parameter specifies whether sections in the source list completely overwrite previously existing sections with the same name in the destination list. If a section in the destination list has the same name as a section being copied, you can overwrite the section or merge the two sections. If you merge the two sections, items with the same tags are overwritten unless you have disabled duplicate checking using the Ini_SetDuplicateChecking function. Specify a nonzero value or select Yes in the function panel to completely overwrite previously existing sections in the destination. Specify 0 or select No in the function panel to merge the items in sections with the same name into the destination list. Items with the same tag names are overwritten unless you have disabled duplicate checking using the Ini_SetDuplicateChecking function. |
Return Value
| Name | Type | Description | ||
| status | int | Indicates whether the function is successful. A zero indicates success. A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. If the value is from –5000 to –5999, it is one of the error values defined in toolbox.h. The only error you are likely to encounter is:
|
Additional Information
Library: Reading/Writing .ini-Style Files
Include file: toolbox\inifile.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later