Sign in to follow this  
Followers 0
bomboa

GUI input to .ini

5 posts in this topic

Hey, Ive been reading for a while and I know this is probably simple but I just can't figure it out! Can someone tell me how to save the value from an input box to a specific area of a .ini in same directory? Thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

THIS IS THE INPUTBOX EXAMPLE

$1 = InputBox ("TEST","PUT TESXT HERE")
        If $1 <> "" Then
        FileDelete ("TEST.INI")
        FileWrite('TEST.INI', $1)
        MsgBox(0,'Info','Data written to test.ini')
        Else
        MsgBox (-1, " info " , " you did not enter any data !!!")
        EndIfoÝ÷ Ù1ÈHPÃËSQ«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì)U%
ÉÑ ÅÕ½ÐíÑÍÐÅÕ½Ðì°ÄÜÀ°ÄÈÀ¤(ÀÌØí%9|ÄôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÈÀ°ÄÔÀ¤(ÀÌØí%9|ÈôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÔÀ°ÄÔÀ¤(ÀÌØí

DON'T FORGET TO USE THE AUTOIT BIBLE WICH IS THE HELP FILE

HOPE IT HELPS

SEE YA

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Share this post


Link to post
Share on other sites

Use IniWrite()

#include <GUIConstants.au3>
GUICreate("test", 170, 120)
$IN_1 = GUICtrlCreateInput ("",10,20,150)
$IN_2 = GUICtrlCreateInput ("",10,50,150)
$GO = GUICtrlCreateButton ("DO",10,85,150)
GUISetState ()

While 1
    $msg = GUIGetMsg ()
    If $MSG = $GUI_EVENT_CLOSE Then
        ExitLoop
    EndIf
        $1 = GUICtrlRead ($IN_1)
        $2 = GUICtrlRead ($IN_2)
        $DATA = $1 & @CRLF & $2
    If $msg = $GO Then
        If $1 <> "" Or $2 <> "" Then
        IniWrite ( "test.ini", "Controls", "Input1", GUICtrlRead ($IN_1) )
        IniWrite ( "test.ini", "Controls", "Input2", GUICtrlRead ($IN_2) )
        MsgBox(266304,'Info','Data written to test.ini')
        Else
        MsgBox (266288, " info " , " you did not enter any data !!!")
        EndIf
    EndIf
WEnd

Share this post


Link to post
Share on other sites

I have been using Auto-it for 2 weeks and am not really used to it yet. I have searched the forums and havent gotten much details on how to do this. I iried this example but it doesnt show what the current values are.. how would i get it to load the settings and display them again after its ran again.. I have wrote a script that can read an INI but i dont know how to display and write new values. Please help.

I have an ini that i read from that is like

[firstset]

object1 = this1

object2 = this2

object3 = this3

objest4 = this4

.. this goes on for 6 rows

[secondset]

Item1 = setting2

item2 = setting3

item3 = setting4

and this continues on for 5 rows

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