+ Reply to Thread
Results 1 to 3 of 3

Thread: Edit INI File without sections

  1. #1
    Join Date
    May 2007
    Location
    Everett, WA, USA
    Posts
    27

    Default Edit INI File without sections

    Hi Friedrich,

    I'm supporting an existing system that has an INI file that some of my installations have to add entries to.

    This INI file has no sections. When I use the Edit INI File function to add an entry or two, it precedes the new entries with an empty section header, like this:

    existingentry=1
    existingentry=2
    bunchmore=20
    []
    newentry=1
    newentry=2

    I wouldn't expect it to cause a problem, and it appears not to (the application reads its entries without section headers), but it looks a little strange and I'm wondering if there might be a way to get the Edit INI File function to not do that.

    Thanks,

    Wayne

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Edit INI File without sections

    Hi Wayne,

    Well, a file with an empty "section header" is NOT an INI file

    See MSDN:
    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    An INI file is defined as:

    [Section1]
    FirstKey = It all worked out okay.
    SecondKey = By golly, it works.
    ThirdKey = Another test.

    The only way to manipulate your text file (not INI file) is to use the "Handle Text File Operation..." function.

    Does this help?

    Friedrich

  3. #3
    Join Date
    May 2007
    Location
    Everett, WA, USA
    Posts
    27

    Default Re: Edit INI File without sections

    I'm not going to try to defend them, Friedrich, but this "ini" file is generated by code descended from prehistorical times when things were less picky.

    Anyway, your answer was what I was expecting, and yes, it helped.

    Thanks,

    Wayne

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •