I extensively use INI-style files to save configuration and parameters in my applications. I have found more confortable to load the IniFile instrument as a library than as an instrument, so it is available for all of my projects without need to load it for each of them.
It can be useful for you to study the ini.prj example that ships with CVI (you'll find it in \samples\toolbox directory): it covers almost all functions included in the instrument.
For a simple skeleton code, here you'll find some lines of code for saving some configuration information to a file.
int SaveSession (void)
// Saving session data
{
int error = 0;
char msg[128];
IniText T = 0;
// Create a IniText object and reaf existing data from the file
nullChk (T =
Ini_New (0));
errChk (Ini_ReadFromFile (T, "session.cfg"));
// Saving new data
errChk (Ini_PutInt (T, "Session", "Type", type));
// Test results
errChk (Ini_PutInt (T, "Session", "Tested", test));
errChk (Ini_PutInt (T, "Session", "Good", good));
errChk (Ini_PutBoolean (T, "Session", "CalcToBeDone?", toCalc));
// Saving new entries to the file
errChk (Ini_WriteToFile (T, "session.cfg"));
Error:
if (T) Ini_Dispose (T);
if (error < 0) {
sprintf (msg, "Error %d received in %s:\n%s.", error, __FUNCTION__,
GetGeneralErrorString (error));
MessagePopup ("Critical error", msg);
}
return error;
}