Jump to content

.ini data to funcs


bald1
 Share

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? :)

Link to comment
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.

Link to comment
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
Link to comment
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=71019

#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)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        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, "")
    EndSwitch
WEnd
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...