LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Search elements in .INI file

Solved!
Go to solution

Good afternoon,

 

Firstly, I am working with INI files and Excel files. In fact, all my elements of my several INI files are also written in a single Excel File like this :

 

First INI FIle

Tag Name      |     Value     |     Section Name

Tag Name      |     Value     |     Section Name

Tag Name      |     Value     |     Section Name

 

 

Seconde INI File

Tag Name      |     Value     |     Section Name

Tag Name      |     Value     |     Section Name

Tag Name      |     Value     |     Section Name

 

The aim of my application is to refresh the values of the INI files using an Excel file.

 

At the moment, I have also written all my tag names and section names in my program.c and I compare evrey element of my Excel file with all the arrays that contains tag name and sections name in program.c

 

I was wondering if, in CVI 8.5.1, there were any function that can tell me that the Sectionname + Tagname exists in the file i am looking at. If there is, I wouldn't have to store all my datas in many arrays.

 

In fact, I would like to compare my datas directly with my INI file, and not with arrays.

 

I hope I was relatively clear in what I was searching for.

 

Thanks by advance.

Vincent Keresztes

 

 

0 Kudos
Message 1 of 3
(3,837 Views)

Yes and no.

 

Provided that you are going to use the inifile functions located in the toolslib library you can use the command

Ini_NumberOfItems (, "");

However, the ini files generated and read by these functions have a slightly different structure...

 

Have a look at the example ini.prj.

0 Kudos
Message 2 of 3
(3,833 Views)
Solution
Accepted by topic author vincentk

I finally find my solution.

 

I used Ini_ItemExists, which provide me the information I wanted.

 

Thank you for helping me !

0 Kudos
Message 3 of 3
(3,827 Views)