Jump to content

Reading .ini


Recommended Posts

Hi,

I am greating a GUI which, ideally, will read an ini file. Basically I would like to have the user select an option from a dropdown menu, their selection would read a section & key from an ini and return the relevant value. I haven't begun codeing this yet so have no errors, just after the best way to go about it?

For example; the dropdown would contain 'Laptop, PC, Monitor, Keyboard, Mouse'. The ini would contain the make, model and price for each of these (assuming there is only 1 type of each). Which ever is selected from the front end, the make, maodel and price of each should be returned into the GUI.

I'm pretty new so not sure how to go about this exactly, though I would imagine something a little like this at the core (the syntax is probably off, but I can work on that when I have the foundations!);

GUICtrlRead($DropDown)=$UserChoice

IniRead("ini.ini", & $UserChoice, "Make", "Read Error")

Would that be right, or am I fundamentally wrong? I have never pulled information from an ini in AutoIT, so am unsure if I can use a variable there, or if I have structured that argument correctly.

There are probably going to be 50+ choices in the dropdown, so I could really do without repeating things - if an option appears in the ini I would prefer it not to feature in the code as I my have to do this 50+ times!

If I am at all unclear let me know and I'll try to explain a little better!

Thanks in advance for your replies

Andy

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