Ini_SortInternally
- Updated2023-02-21
- 2 minute(s) read
int Ini_SortInternally (IniText handle);
Purpose
Provides the same performance benefits as Ini_Sort, but does not alter the order of the tag/value pairs in the list identified by handle.
When internal sorting is enabled by this function, an additional internal list of pointers to tag/value pairs is created, sorted, and used to speed up IniText operations. The original list is maintained as well so that the order of the tag/value pairs in the list is preserved when the IniText is written to a file or traversed using the Ini_NthItemName and Ini_NthSectionName functions.
If the Ini_Text has enabled regular sorting by calling Ini_Sort or by passing TRUE to Ini_New then enabling internal sorting with this function will not improve performance any further.
Effects of Sorting on Performance
Enabling sorting has the following effects on performance:
- Getting values from the in-memory list is faster.
- If you enable checking for duplicates (the default), adding values to the in-memory list is faster than it is for a non-sorted list.
- If you disable checking for duplicates, adding values to the in-memory list is slower than it is for a non-sorted list. For more information, refer to the Ini_SetDuplicateChecking function.
Parameters
| Input | ||
| Name | Type | Description |
| handle | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs. |
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 5.0 and later