07-06-2008 06:38 PM
07-06-2008 11:45 PM
07-07-2008 07:16 AM
Be aware that these function panel routines strip out comments and any other unrecognised entries in the INI file. I tend to use the GetPrivateProfile... group of Windows API functions.
Kevin Snelling (CVI Certified developer)
07-07-2008 11:45 PM
07-08-2008 02:11 AM
Standard release of IniFile instrument splits too large lines into several lines as you can see in your file "after": this is clearly stated in the online help for Ini_PutString and Ini_PutRawString functions:
If the string is very long, the instrument driver will split it across multiple lines associated with the same tag name. This is done by generating new tag names, such as in:
<Tag Name> Line 0001 = "first part of line ........" <Tag Name> Line 0002 = "second part of line ......." <Tag Name> Line 0003 = "third part of line" When you attempt to retrieve the string from the file by calling Ini_GetPointerToString, Ini_GetStringCopy, or Ini_GetStringIntoBuffer, you only need to enter the same Tag Name that you passed into this function. The instrument driver takes care of reconstructing the original single string from the multiple lines.
"very long" defaults to 80 characters and is not modifiable unless you create a modified copy of the instrument (it's defined in macro INI_NUM_CHARS_PER_LINE in inifile.c source file).
BTW I don't understand how you succeed in placing inside a ini file a text like
bearing = 1.12 ; bearing in decimal........
including the comment, unless the comment itself is part of the string. In this case, though, how you manage to store a string without surrounding quotes? Can you explain me? It could be useful sometimes to add comments; since now I managed it adding a field like itemComment = "comment string"
07-08-2008 02:33 AM
07-08-2008 05:34 AM
Ok, so the instrument behaviour is this one:
The strange thing is that a totally commented row should not be maintained over a WriteToFile as highlighted from Kevin, but I see that in your "after" file some commented rows are present...
07-08-2008 09:40 AM
07-08-2008 09:53 AM
07-08-2008 11:08 AM
I think there is another problem in your code.
In the before, the data were added using Ini_PutDouble() function, which is now overwritten with Ini_PutRawString(). The differnce results in new " " quotes appearing in your text.
layosh