Hi Amin,
sorry for my bad english ... this is a solution to your problem.
Open the file INIFILE.C (you find it, for example, in C:\PROGRAM FILES\NATIONAL INSTRUMENTS\CVI70\toolslib\toolbox\INIFILE.C)
You must modify two functions:
Ini_WriteEntry ()
Ini_ReadGeneric ().
Function Ini_WriteEntry() before:
.......
len = strlen(entry->value);
if (len <= INI_NUM_CHARS_PER_LINE)
{
sprintf (outputBuffer, entry->addMarkerQuotes ? "%s%s\"%s\"" : "%s%s%s", entry->name, iniText->nameValueOutputSeparatorToken, entry->value);
errChk ((*outputFunc)(outputDest, outputBuffer));
}
else
{
srcTextPtr = entry->value;
i = 1;
.......
Function Ini_WriteEntry() after:
.......
len = strlen(entry->value);
if (len <= INI_NUM_CHARS_PER_LINE)
{
if (entry->name[0] == ';')
sprintf (outputBuffer, "%s", entry->name);
else
sprintf (outputBuffer, entry->addMarkerQuotes ? "%s%s\"%s\"" : "%s%s%s", entry->name, iniText->nameValueOutputSeparatorToken, entry->value);
errChk ((*outputFunc)(outputDest, outputBuffer));
}
else
{
srcTextPtr = entry->value;
i = 1;
.......
Function Ini_ReadGeneric() before:
.......
switch (lineType)
{
case kIni_SectionLine:
if (theIniText->sectionFilter && !theIniText->sectionFilter(theIniText, theIniText->sectionFilterCallbackData, sectionBuf))
currentSection = NULL;
else
{
nullChk(newSection = Ini_NewSection(sectionBuf, theIniText->sorted));
newSection->sourceLine = lineRead;
errChk(ListInsertItem(theIniText->sectionList, &newSection, END_OF_LIST));
currentSection = newSection;
newSection = NULL;
}
break;
case kIni_TagAndValueLine:
if (currentSection)
{
nullChk(newEntry = Ini_NewEntry(itemNameBuf, valueBuf, TRUE));
newEntry->sourceLine = lineRead;
errChk(ListInsertItem(currentSection->entryList, &newEntry, END_OF_LIST));
newEntry = NULL;
}
break;
default:
break;
}
.......
Function Ini_ReadGeneric() after:
.......
switch (lineType)
{
case kIni_SectionLine:
if (theIniText->sectionFilter && !theIniText->sectionFilter(theIniText, theIniText->sectionFilterCallbackData, sectionBuf))
currentSection = NULL;
else
{
nullChk(newSection = Ini_NewSection(sectionBuf, theIniText->sorted));
newSection->sourceLine = lineRead;
errChk(ListInsertItem(theIniText->sectionList, &newSection, END_OF_LIST));
currentSection = newSection;
newSection = NULL;
}
break;
case kIni_TagAndValueLine:
if (currentSection)
{
nullChk(newEntry = Ini_NewEntry(itemNameBuf, valueBuf, TRUE));
newEntry->sourceLine = lineRead;
errChk(ListInsertItem(currentSection->entryList, &newEntry, END_OF_LIST));
newEntry = NULL;
}
break;
case kIni_CommentLine:
if (currentSection)
{
nullChk(newEntry = Ini_NewEntry(lineBuf, "", TRUE));
newEntry->sourceLine = lineRead;
errChk(ListInsertItem(currentSection->entryList, &newEntry, END_OF_LIST));
newEntry = NULL;
}
break;
default:
break;
}
.......
Inifile before reading:
[EXAMPLE]
; Acquisition setup
OnOff = 1
Board = 1 ; Number of board
NumberOfChannels = 10 ; Number of channels
....
Inifile after writing:
[EXAMPLE]
; Acquisition setup
OnOff = 1
Board = 1
NumberOfChannels = 10
....
Bye,
Luca