Jump to content
Sign in to follow this  

.ini data to funcs

Recommended Posts


Hey guys

I bet this is a question often brought up, tho i failed to find my answer via the search function, and help file wasn't much help either. I have chunks of script that I wish to make into functions. The arrays and variables belonging to the functions i would very much like to put into outside .ini files, to make it all easier to read, develop and trim. How do i go about this? How do I pull data from an outside (of script) .ini file into the functions called in the script that i want to run? :)

Share this post

Link to post
Share on other sites

Look at IniRead.

Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post

Link to post
Share on other sites

I am, but i need help to incorporate it into the entire picture. Could u perhaps make a little example that i could use in the scenario i described? :)

edit: Also, how do i build up this .ini file? Same way as i do with vars and arrays in autoit format?

Edited by bald1

Share this post

Link to post
Share on other sites


#include <GUIConstants.au3>

$MainGUI = GUICreate("INI Stuff", 202, 95, -1, -1)
$Input = GUICtrlCreateInput("", 8, 8, 185, 21)
$Clear = GUICtrlCreateButton ("Clear Input's Data", 8, 36, 185, 25)
$IniWrite = GUICtrlCreateButton("Ini Write", 8, 65, 57, 25, 0)
$IniRead = GUICtrlCreateButton("Ini Read", 72, 65, 57, 25, 0)
$IniDelete = GUICtrlCreateButton("Ini Delete", 136, 65, 57, 25, 0)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
        Case $IniWrite
            IniWrite ("Ini File.ini", "Input Section", "Input Info", GUICtrlRead($Input))
        Case $IniRead
            GUICtrlSetData ($Input, IniRead ("Ini File.ini", "Input Section", "Input Info", ""))
        Case $IniDelete
            IniDelete ("Ini File.ini", "Input Section", "Input Info")
        Case $Clear
            GUICtrlSetData ($Input, "")

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.