Jump to content

Problem with IniReadSection


Damein
 Share

Recommended Posts

Currently I have a ListView setup like this:

$PlayListView = GuiCtrlCreateList("", 830, 10, 160, 708)
$PlayListSongNames = IniReadSection("Playlists.ini", $CurrentPlayList)
For $i = 0 To $PlayListSongNames[0][0]
  GuiCtrlSetData($PlayListView, $PlayListSongNames[$i][0])
Next

And in the Ini I have

Test=http://www.bleh.com
Test1=http://www.blah.com
Test2=http://www.blarg.com

With this setup I get no items in my list at all. But if I change the

GuiCtrlSetData($PlayListView, $PlayListSongNames[$i][1])

I can now see the URL's. But I can never see the key's, why is that?

I have done _ArrayDisplay and can see the keys that way, so why is it not showing now?

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

You see only one item because you are using only one (either [0] or [1])

To be able to see both, you will need to add a column to your listview and to add sub-items.

Have a look at the examples in the help file - you should be able to figure how to do it correctly.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

No, no, no. Sorry, but I know that. I am trying to only show one, the key. I don't want to be able to see the value of the INI.

I was just merely stating the changing from Key/Value showed the value correctly, but not the key.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

The key is in the [$I][0] element of the array, the value is in the [$I][1] element, so if you only reference one or the other, you'll only see that one or the other. If you want to see the key and the value, you will need to reference both the 0 and the 1 elements.

I don't understand what your question is about; if you only want to see the value, then why worry that you can't see the key?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I don't want to see the value at all, I thought I made that clear in my second posting.. let me just do a quick re-post.

In a ListView I want to:

1: Read an INI into a var

2: From a For statement add every KEY in the desired Section from the INI.

I never want to see the value, I only want to see the key. But, that is not working at all. The only thing I can make happen is to show the value, but I merely am doing so to prove that the INI is reading accurately.

Once again, I want to see the key in my listview, not the value. But for some reason it won't show it in the ListView.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

I've figured this out, thanks.

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

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...