Jump to content

INI problem...


 Share

Recommended Posts

I have an INI with names separated by commas, it looks like this:

key=name1,name2,name3,

And I did this to use the commas as delimiters:

$var = INIRead("C:\buddies.ini", "BuddyList", "Buddies", "Unable to read INI.")
    $arr = StringSplit($var, ",")

And then I create a listview filled with items from the ini so it appears like this:

name1

name2

name3

I used this code to do that ^

For $val In $arr
        GUICtrlCreateListViewItem("|" & $val, $nListview); Creates the listview items from the INI file
    Next

But after all the items are loaded from the INI file I have this one listview item that is selectable but has no name, and I know for sure that it is a comma because when I delete it my INI file goes from looking like this:

key=name1,name2,name3,

to this:

key=name1,name2,name3

How do I remove this blank listview item from my listview without taking away the needed comma in the INI?

Link to comment
Share on other sites

I hope you didn't expect a rush of replies in 32 minutes.

If $var <> "" Then GUICtrlCreateListViewItem("|" & $val, $nListview); Creates the listview items from the INI file

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

That doesn't do anything? Still have the same problem.

That's because it should be $val not $var

If $val <> "" Then GUICtrlCreateListViewItem("|" & $val, $nListview); Creates the listview items from the INI file

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...