LabWindows/CVI

Ini_CopySectionEx

int Ini_CopySectionEx (IniText source, const char sectionToCopy[], IniText destination, const char destinationSectionToCopyTo[], int overwriteDuplicateSections);

Purpose

Copies a whole section 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.

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.
destinationSectionToCopyTo const char [] This parameter specifies the name of the destination list section into which to write.

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 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 was 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:
–12 Out of memory!

Additional Information

Library: Reading/Writing .ini-Style Files

Include file: toolbox\inifile.h

LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later