Sign in to follow this  
Followers 0
Ozi

INI problem...

4 posts in this topic

I need my script to be able to read a section without a set amount of lines and plug it into the script.

Example

[scriptPart1]

send("blab")

run("name.exe")

The script will add

send("blab")

run("name.exe")

where if the ini said

[scriptpart1]

send("blab")

it would only add

send("blab")

the thing is I need to be able to have an infinite amount of lines as I want my script to mostly be held in the ini file so that people could download my script and only have to download the ini for updates and changes.

The above post posted by AcidCorps that's in bold is VERY similar to what I want to do except I want to use actual variables.

For example I want to have:

[section1]

key1=14

key2=13

and it will all the values that are in the INI inside my script and where if like AcidCorps stated above in his post if I did,

[section1]

key1=14

It would only add the value 14. And as AcidCorps said I want to have an infinite amount of keys and values so people could configure what my program does with just the INI. How though?

Share this post


Link to post
Share on other sites



im confused. How will these values tell you program wat to do. If i understand i think you want to use inireadsection, and then us a for loop to read the array.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'm assigning numbers 2-14 to hex values. It's for a button presser application.

And yea,

That's what someone told me but it doesn't work.

Example,

$varName = INIReadSection ( "C:\Documents And Settings\Ozi\Desktop\test.ini", "section1" )

Then I would have to do:

If varName = "14" Then

Msgbox ( 0, "", "whatever" )

and i cant do that because if the user put in a 14 or a combination of 14,13 like:

key1 = 14,13

so im screwed. but i know this is possible because there are programs that can do this.

Edited by Ozi

Share this post


Link to post
Share on other sites

You say infinite, but the standard ini functions only do 32 kb's.

I don't see what is wrong with IniReadSection(), it reads everything in that section into an array... you could always parse the values to see if there is more than one with a StringSplit() or something.

I'm thinking you need to re-think you're logic a bit, create an example ini, then create the script that would run it, and post what you have that stumped you to that point.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
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
Sign in to follow this  
Followers 0