Sign in to follow this  
Followers 0
Rydextillxixdiex

Curious about Ini.

3 posts in this topic

I see people using ini read/write in their scripting and im curious as to what exactly it does. Can somebody give me an example of try to explain it to me.

Don't go out of your way as i do not NEED this information for anything im working on, but am just curious.

Thanks All.


...will never learn all there is to know about autoit, no worries...i came to the forums :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

INI:

The INI file format is a de facto standard for configuration files. INI files are simple text files with a basic structure. They are commonly associated with Microsoft Windows, but are also used on other platforms. The name "INI file" comes from the filename extension usually used, ".INI", that stands for "initialization". Sometimes, files using the INI file format will use a different extension, such as ".CFG", ".conf", or ".TXT".

Wikipedia

I use INI files a lot mainly to save instructions about the program, examples of this can be: startup position, themes, data, URL's. Loads of things can be saved in them!

Check out this, which I made, InsideNI|INedisnI it allows you to display data from an INI file in a treeview.

Edit: Added link to InsideNI|INedisnI

Edited by JamesBrooks

Share this post


Link to post
Share on other sites

I see people using ini read/write in their scripting and im curious as to what exactly it does.

Ini files can save information which can be used in another execution of your script.

Can somebody give me an example of try to explain it to me.

This is probably as basic as I can create.

$value = 'value'
If Not FileExists('test.ini') Then
    ; create the ini file and save the key and value
    IniWrite('test.ini', 'section', 'key', 'value')
Else
    ; ini file exists so show the value of key
    $return = IniRead('test.ini', 'section', 'key', 'error')
    MsgBox(0x40000, Default, $return)
EndIf

The first run will create the ini file and save the section, key and value. Another execution will read the key from within the section and return the value.

:)

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