ini_SetSectionFilter
Hello
I want to know how to use the ini_SetSectionFilter functions.
When read the help file: Ini_SetSectionFilter
int Ini_SetSectionFilter (IniText handle, Ini_SectionFilterFunc sectionFilterFunction, void * callbackData);
need for a new function to define
int CVICALLBACK FilterFunction(IniText theIniText, void *callbackData, char *sectionName);
Anyway, how to set the FilterFunction function? are there examples of code? and where I can get members of the iniText sets?
I'm trying to save some tests given in files using the functions iniText because of the data are readable and searchable. but when the data grows, I need to read a subset of data without the overhead of reading the entire file into memory.
Thank you very much in advance.
Hi again,
I can sound as if I repeat myself, but this is because there is only one way to explain this.
The sectionName parameter is passed to your callback as input.
It is filled with Ini_ReadFromFile according to the current name of the section that it is reading.
So, you first declare and implement a function like this: CVICALLBACK MyFilterFunction(IniText theIniText, void *callbackData, char *sectionName) int;
Second, to type this name (function FilterFunction) as the second parameter in Ini_SetSectionFilter (...).
So, your code will look like: Ini_SetSectionFilter (iniHandle, MyFilterFunction, NULL);
Even at this stage, your code compiles, but you must fill in the MyFilterFunction either works the way you want.
For example, when you implement the MyFilterFunction, you would write something like this:
int CVICALLBACK MyFilterFunction(IniText iniHandle, void *callbackData, char sectionName[100])
{
If (sectionName [0] == 'A') return 1;
else return 0;
}
The function example I gave above will filter (skip) all section names not starting not not by "A".
Hope this helps,
Tags: NI Software
Similar Questions
Maybe you are looking for
-
Hello, is it possible to reload the machine (Macbook 12 "retina) while it is in target disk mode? Thank you
-
I recently updated my Firefox on this computer and for some reason, there is a giant space on the bottom of my browser. It looks like this: http://imgur.com/56ZdwhF I have no problem on my other computers and also no problem with Google Chrome on thi
-
I have a lot of pages bookmark in Google Chrome, and I don't want their favorite one at a time.
-
"Partition recovery has been deleted" Message in creation of recovery media
HP Pavilion 2205tx - C5j09PA #UUF G4 Windows 8 64-bit "Partition recovery has been deleted" Message in creation of recovery media. I bought my new HP pavilion laptop G4 two days ago only and has not changed anything in the two players named drive C:
-
Download Windows Media Center in Windows XP Home Edition?
I want to download Windows Media Center in Windows XP Home Edition. I can do or do I have to install Windows XP Media Center Edition? If I install XP Media Center Edition can just move from Windows XP Home Edition?Thank you!David