kkhyoyoyo Posted May 19, 2015 Share Posted May 19, 2015 Before I ask u guys. I'm sorry I can't speak english.I think I can't understand u. so Include screenshot under page. I hope understand you.when someone put "01"(input1) and put "03"(input2) then checkbox1 checked. after this ini writeIniWrite("example.ini","General","Pc Name" , GUICtrlRead($input3) & GUICtrlRead($Input1)) is this correct?I'm sorry. I'm really newby.. Help me~#include <ButtonConstants.au3>#include <EditConstants.au3>#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\input01.kxf$Form1_1 = GUICreate("Form1", 324, 376, 320, 240)$Input1 = GUICtrlCreateInput("PC start number", 32, 85, 113, 21)$Input2 = GUICtrlCreateInput("PC last number", 172, 85, 113, 21)$Input3 = GUICtrlCreateInput("PC name", 104, 24, 113, 21)$Button1 = GUICtrlCreateButton("confirm", 32, 280, 81, 25)$Button2 = GUICtrlCreateButton("cancle", 172, 280, 81, 25)$Checkbox2 = GUICtrlCreateCheckbox("CONFIG2", 32, 115, 201, 17)$Checkbox1 = GUICtrlCreateCheckbox("CONFIG1", 32, 55, 73, 17)$Input4 = GUICtrlCreateInput("PC start number", 32, 145, 113, 21)$Input5 = GUICtrlCreateInput("PC last number", 172, 145, 113, 21)$Checkbox3 = GUICtrlCreateCheckbox("CONFIG3", 32, 175, 113, 17)$Input6 = GUICtrlCreateInput("PC start number", 32, 205, 113, 21)$Input7 = GUICtrlCreateInput("PC last number", 172, 205, 113, 21)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button2 $Button2 = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 If GUICtrlRead($Input1) = 1 Then IniWrite("example.ini","General","Pc Name" , GUICtrlRead($input3) & GUICtrlRead($Input1))EndIf EndSelect WEndhow to make like this picture Iniwrite.. Link to comment Share on other sites More sharing options...
javiwhite Posted May 19, 2015 Share Posted May 19, 2015 Hey,Is this what you're looking for?I think i've understood what you're after.expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\input01.kxf $Form1_1 = GUICreate("Form1", 324, 376, 320, 240) $Input1 = GUICtrlCreateInput("PC start number", 32, 85, 113, 21) $Input2 = GUICtrlCreateInput("PC last number", 172, 85, 113, 21) $Input3 = GUICtrlCreateInput("PC name", 104, 24, 113, 21) $Button1 = GUICtrlCreateButton("confirm", 32, 280, 81, 25) $Button2 = GUICtrlCreateButton("cancle", 172, 280, 81, 25) $Checkbox2 = GUICtrlCreateCheckbox("CONFIG2", 32, 115, 201, 17) $Checkbox1 = GUICtrlCreateCheckbox("CONFIG1", 32, 55, 73, 17) $Input4 = GUICtrlCreateInput("PC start number", 32, 145, 113, 21) $Input5 = GUICtrlCreateInput("PC last number", 172, 145, 113, 21) $Checkbox3 = GUICtrlCreateCheckbox("CONFIG3", 32, 175, 113, 17) $Input6 = GUICtrlCreateInput("PC start number", 32, 205, 113, 21) $Input7 = GUICtrlCreateInput("PC last number", 172, 205, 113, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button2 $Button2 = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 $Data = '' if GUIctrlRead($CheckBox1) == $GUI_CHECKED Then $Data &= GUICtrlRead($input3) & GUICtrlRead($Input1) if GUIctrlRead($CheckBox2) == $GUI_CHECKED Then $Data &= GUICtrlRead($input3) & GUICtrlRead($Input4) if GUIctrlRead($CheckBox3) == $GUI_CHECKED Then $Data &= GUICtrlRead($input3) & GUICtrlRead($Input6) IniWrite("example.ini","General","Pc Name" , $Data) EndSelect WEndMany Thanks Javi give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime. Link to comment Share on other sites More sharing options...
kkhyoyoyo Posted May 20, 2015 Author Share Posted May 20, 2015 thanks for your answer javiwhite~but it dosen't work..I mean its not making ini filecan u check one more time? Link to comment Share on other sites More sharing options...
nitekram Posted May 20, 2015 Share Posted May 20, 2015 Try this:expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\input01.kxf $Form1_1 = GUICreate("Form1", 324, 376, 320, 240) $Input1 = GUICtrlCreateInput("PC start number", 32, 85, 113, 21) $Input2 = GUICtrlCreateInput("PC last number", 172, 85, 113, 21) $Input3 = GUICtrlCreateInput("PC name", 104, 24, 113, 21) $Button1 = GUICtrlCreateButton("confirm", 32, 280, 81, 25) $Button2 = GUICtrlCreateButton("cancle", 172, 280, 81, 25) $Checkbox2 = GUICtrlCreateCheckbox("CONFIG2", 32, 115, 201, 17) $Checkbox1 = GUICtrlCreateCheckbox("CONFIG1", 32, 55, 73, 17) $Input4 = GUICtrlCreateInput("PC start number", 32, 145, 113, 21) $Input5 = GUICtrlCreateInput("PC last number", 172, 145, 113, 21) $Checkbox3 = GUICtrlCreateCheckbox("CONFIG3", 32, 175, 113, 17) $Input6 = GUICtrlCreateInput("PC start number", 32, 205, 113, 21) $Input7 = GUICtrlCreateInput("PC last number", 172, 205, 113, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button2 $Button2 = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 if GUIctrlRead($CheckBox1) == $GUI_CHECKED Then IniWrite("example.ini","CONFIG1","Pc Name" , GUICtrlRead($input3)) IniWrite("example.ini","CONFIG1","PC start number" , $Input1) IniWrite("example.ini","CONFIG1","PC last number" , $Input2) EndIf if GUIctrlRead($CheckBox2) == $GUI_CHECKED Then IniWrite("example.ini","CONFIG2","Pc Name" , GUICtrlRead($input3)) IniWrite("example.ini","CONFIG2","PC start number" , $Input4) IniWrite("example.ini","CONFIG2","PC last number" , $Input5) EndIf if GUIctrlRead($CheckBox3) == $GUI_CHECKED Then IniWrite("example.ini","CONFIG3","Pc Name" , GUICtrlRead($input3)) IniWrite("example.ini","CONFIG3","PC start number" , $Input6) IniWrite("example.ini","CONFIG3","PC last number" , $Input7) EndIf EndSelect WEnd 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
kkhyoyoyo Posted May 20, 2015 Author Share Posted May 20, 2015 thanks guys~ u guys really helpfulcan i ask one more thing?I want show when put "01"(input1) and put "03"(input2) it will be INI file likepc name=pc01pc name=pc02pc name=pc03 I mean 01 through 03 Link to comment Share on other sites More sharing options...
nitekram Posted May 20, 2015 Share Posted May 20, 2015 That would just mean you have to change the first input box (computer name) to what ever you want...If you want to use the same computer name for each configuration.If that is not the case, just create another input box for each of the other configurations, and then change the $input1 for the right config to your new input variable. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
kkhyoyoyo Posted May 21, 2015 Author Share Posted May 21, 2015 Im sorry.. I could't understand ur explanationhow about this souce?$ini = @ScriptDir & "\test.ini"$key=1For $value = 1 To 10 Step 1 IniWriteSection($ini, "general " & $value, "") For $key = 1 To 10 Step 1 IniWrite($ini, "Section " & $value, "Value" &$key, $key) NextNextIf I use this soucecould u suggest more better souce for me? Link to comment Share on other sites More sharing options...
nitekram Posted May 21, 2015 Share Posted May 21, 2015 I am not sure what you are looking for. Can you show manually the format you are looking for with the INI file layout - with a couple of entries. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
kkhyoyoyo Posted May 21, 2015 Author Share Posted May 21, 2015 Im sorry. my explanation suck..so I made paint. I hope u undersand my think Link to comment Share on other sites More sharing options...
nitekram Posted May 21, 2015 Share Posted May 21, 2015 (edited) I think your logic might be wrong here. The PC NAME should be unique in the INI file?[General] - has to be uniquekey1 - the key can be only one, under each section name General, so your next section can also contain the key namekey2 = data - the data can be anything you wantWIKI INI FILE Edited May 21, 2015 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
nitekram Posted May 21, 2015 Share Posted May 21, 2015 Maybe you can use this to get the idea?expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\input01.kxf $Form1_1 = GUICreate("Form1", 324, 376, 320, 240) $Input1 = GUICtrlCreateInput("1", 32, 85, 113, 21) $Input2 = GUICtrlCreateInput("3", 172, 85, 113, 21) $Input3 = GUICtrlCreateInput("PC name", 104, 24, 113, 21) $Button1 = GUICtrlCreateButton("confirm", 32, 280, 81, 25) $Button2 = GUICtrlCreateButton("cancle", 172, 280, 81, 25) $Checkbox2 = GUICtrlCreateCheckbox("CONFIG2", 32, 115, 201, 17) $Checkbox1 = GUICtrlCreateCheckbox("CONFIG1", 32, 55, 73, 17) $Input4 = GUICtrlCreateInput("4", 32, 145, 113, 21) $Input5 = GUICtrlCreateInput("6", 172, 145, 113, 21) $Checkbox3 = GUICtrlCreateCheckbox("CONFIG3", 32, 175, 113, 17) $Input6 = GUICtrlCreateInput("7", 32, 205, 113, 21) $Input7 = GUICtrlCreateInput("9", 172, 205, 113, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button2 $Button2 = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 if GUIctrlRead($CheckBox1) == $GUI_CHECKED Then ; config 1 For $x = GUICtrlRead($Input1) To GUICtrlRead($Input2) IniWrite("example.ini", "General" ,"Pc Name" & $x , '(config1)') Next EndIf if GUIctrlRead($CheckBox2) == $GUI_CHECKED Then ; config 2 For $x = GUICtrlRead($Input4) To GUICtrlRead($Input5) IniWrite("example.ini", "General" ,"Pc Name" & $x , '(config2)') Next EndIf if GUIctrlRead($CheckBox3) == $GUI_CHECKED Then For $x = GUICtrlRead($Input6) To GUICtrlRead($Input7) IniWrite("example.ini", "General" ,"Pc Name" & $x , '(config3)') Next EndIf EndSelect WEnd 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now