Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Ini_GetInt Returns Incorrect Values in LabWindows/CVI

Primary Software: LabWindows/CVI Development Systems>>Full Development System
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I created an INI file with several sections, each with several number fields. Whenever I use the Ini_GetInt method to retrieve these fields, the resulting value is always a very large/small, incorrect number. How can I read correct number values from my INI file?

Solution:
This error occurs when you specify an invalid section name (the second parameter to this function). The most common mistake is to include the square brackets around the text for this parameter. For example, if your INI files appears as follows:

[section 1]
    field1 = 1
[section 2]
    field2 = 2


The correct syntax to retrieve field1 would be:
Ini_GetInt(iniText, "section 1", "field1", &value);

As opposed to:
Ini_GetInt(iniText, "[section 1]", "field1", &value);


Related Links:

Attachments:





Report Date: 07/27/2007
Last Updated: 08/25/2007
Document ID: 4BQDD5SN

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit