Ini_New
- Updated2023-02-21
- 3 minute(s) read
IniText Ini_New (int automaticSorting);
Purpose
Creates an object that can contain an in-memory list of tag/value pairs within sections. You can complete the following:
- Read tag/value pairs into this object using the Ini_ReadFromFile or Ini_ReadFromRegistry functions, and then obtain the values using the Ini_Get... functions.
- Insert tag/value pairs into this object using the Ini_Put... functions, and then write the tag/value pairs to the system using the Ini_WriteToFile or Ini_WriteToRegistry functions.
Since this instrument driver has not been implemented with any multithread-safe locking, National Instruments recommends that you do not share the same .ini object among multiple threads. You can have multiple .ini objects among multiple threads as long has no single .ini object is shared among the threads.
This function allows you to choose whether the in-memory list is automatically sorted. Refer to the help for the automaticSorting parameter for information about how automatic sorting affects performance.
By default, each time you add an object to the in-memory list using one of the Ini_Put functions, a check is made for items with the same name. This can prevent unwanted duplicates, but it also can slow performance. You can disable this feature using the Ini_SetDuplicateChecking function.
Parameters
| Input | ||
| Name | Type | Description |
| automaticSorting | int | Pass a non-zero value or select Yes in the function panel to maintain the in-memory list of tag/value pairs in sorted order. The sorting is based on section name and tag name within section name. The sorting is case-insensitive. Pass 0 or select No in the function panel to maintain the order in which the sections and tags were created or read from the file. You can dynamically change the sorting mode by calling Ini_Sort or Ini_DisableSorting. Effects of Sorting on PerformanceEnabling sorting has the following effects on performance:
|
Return Value
| Name | Type | Description |
| handle | IniText | The handle to the object created in this function. 0 is returned if there is not enough memory. Use this handle as the first parameter to all of the other functions in this instrument driver. |
Additional Information
Library: Reading/Writing .ini-Style Files
Include file: toolbox\inifile.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later
