Jump to content

Not about AutoIt


Recommended Posts

INI-files can be changed with the IniWrite command. a simple search in the helpfile should show you everything you can do with INI-files.

But the second part...

A file cannot be linked to another file, so your question is what's wrong. Maybe there are some people out there that can read your mind and can help you. But with that little information you provide I doubt that.

Besides just waiting one hour and then complaining that you didn't receive any help is a bit strange. There are parts of the world where it's deep night just now and usually everyone is asleep.

Link to comment
Share on other sites

yep.. just cause you have an .ini does not mean the program you want to read it.. will read it.

if the program has a .ini already.. you might just try editing it

what exactly are you trying to do?

we are here to help

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

black.. thats obvious if they are both able to use the same .ini

i think he meant use any program... with any .ini

which is just .... plain.... crazy

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Link to comment
Share on other sites

ok...me write script...me compile script to .exe ... me ask u guys for help making .ini file to configure certain things in the .exe "autoit script"...me rephrase question to help u guys understand...and no there obviously isnt a .ini file for the program already...btw this is an .ini file for me conditional statement script...

Thanks,

Dan

Link to comment
Share on other sites

ok...me write script...me compile script to .exe ... me ask u guys for help making .ini file to configure certain things in the .exe "autoit script"...me rephrase question to help u guys understand...and no there obviously isnt a .ini file for the program already...btw this is an .ini file for me conditional statement script...

Thanks,

Dan

<{POST_SNAPBACK}>

IniRead ( "filename", "section", "key", "default" )

config.ini config1 myvar notfound

Contents of config.ini

[config1]

myvar = myvalue

Code to retrieve myvar's value

$readmyini = IniRead ( "config.ini", "config1", "myvar", "notfound" )
msgbox(0,"Value", "The value of myvar is " & $readmyini)

Success: Returns the requested key value.

Failure: Returns the default string if requested key not found.

A standard ini file looks like:

[sectionName]

Key=Value

Code to write value to myvar

$writevalue = InputBox ( "Value", "Enter Value" , "blah" )
IniWrite ( "config.ini", "config1", "myvar", $writevalue )

This is all straight outta the help file with very minor alteration. Have you read it?

Link to comment
Share on other sites

Just to confuse you a bit more, if you want multiple scripts to use the same INI, I normally store the INI location in the registry. You can also have the program read the ini file, and if it fails, you could have it write the default one.

check out RegWrite and RegRead functions in the manual.

I made a few programs for others, and the program would ask them questions on file locations the first time, and then it would store these defaults on the computer, later it would just read these and not have to ask each time. My second script I gave them read the reg entry to determine that INI and knew the file locations. I never had to worry about where they stored anything, and didn't have to use any searches.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

IniWrite( "Config.ini", "Settings", "Username", "JoeUser") Would write this to Config.ini

[settings]

Username=JoeUser

To read it you would do

IniRead("Config.ini", "Settings", "Username", "Not Found")

The return value would be JoeUser. And if the key, "Username" didn't exist, it would return "Not Found".

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
Link to comment
Share on other sites

What do you mean. If a .ini looks like this:

[information]

Username=JoeUser

Password=JoePass

and you wanted to change the password, you would do.

IniWrite("Config.ini", "Information", "Password", "JoePass2")

This would:

a.) If the key "Password" doesn't exist, it would write the key in with the value.

b.) If the key "Password" does exist, it would change the value to JoePass2

Edit:

A standard ini file looks like:

[sectionName]Key=Value

Edited by the_lord_mephy
My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]
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...