Golbez Posted July 21, 2007 Share Posted July 21, 2007 yeah i got board so i tried making a script that would help me write inis faster.. for some reason it wont read the input from the input boxs.. what did i do wroung i cant figure it out its probley something stupid expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> Opt("GUIOnEventMode", 1) Global $Group1, $Group2, $Group3, $Group4, $Input1, $Input2, $Input3, $Input4 Global $Button1, $ininame, $section, $key, $value, $ini $ini = GUICreate("Easy Ini Writer", 194, 274, 193, 115) $Group1 = GUICtrlCreateGroup("Ini File Name", 8, 8, 177, 49) $Input1 = GUICtrlCreateInput("", 18, 26, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $ininame = @ScriptDir & "\" & GUICtrlRead($Input1) & ".ini" $Group2 = GUICtrlCreateGroup("Section Name", 8, 64, 177, 49) $Input2 = GUICtrlCreateInput("", 18, 82, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $section = GUICtrlRead($Input2) $Group3 = GUICtrlCreateGroup("Key name", 8, 120, 177, 49) $Input3 = GUICtrlCreateInput("", 18, 138, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $key = GUICtrlRead($Input3) $Group4 = GUICtrlCreateGroup("Value", 8, 176, 177, 49) $Input4 = GUICtrlCreateInput("", 18, 194, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $value = GUICtrlRead($Input4) $Button1 = GUICtrlCreateButton("Write Ini", 40, 232, 113, 33, 0) GUICtrlSetOnEvent(-1, "_ini") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $ini) GUISetState() While 1 Sleep(2000) WEnd Func Terminate() Exit EndFunc Func _ini() IniWrite($ininame, $section, $key, $value) Sleep(200) Terminate() EndFunc Func OldWay() $inifile = "" $section = "" $key = "" $value = "" IniWrite($inifile, $section, $key, $value) ;ClipPut (" = IniRead(" & $inifilea & ", " & $sectiona & ", " & $key & ", " & $value &")") EndFunc Link to comment Share on other sites More sharing options...
figgler Posted July 21, 2007 Share Posted July 21, 2007 Have you tried $Button1 = GUICtrlCreateButton("Write Ini", 40, 232, 113, 33, 0) GUICtrlSetOnEvent($Button1, "_ini") Link to comment Share on other sites More sharing options...
Golbez Posted July 21, 2007 Author Share Posted July 21, 2007 (edited) it will write the ini.. it wont write the values. it doesnt read the input boxs sry i was unclear Edited July 21, 2007 by Golbez Link to comment Share on other sites More sharing options...
Developers Jos Posted July 21, 2007 Developers Share Posted July 21, 2007 it will write the ini..it wont write the values.it doesnt read the input boxssry i was unclearYou need to do a GuiRead() just before writing to the INI file ... NOT before displaying the GUI... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Golbez Posted July 21, 2007 Author Share Posted July 21, 2007 (edited) kk thanx! works now move to Example Scripts please expandcollapse popup#include <GUIConstants.au3> #include <Constants.au3> Opt("GUIOnEventMode", 1) Global $Group1, $Group2, $Group3, $Group4, $Input1, $Input2, $Input3, $Input4 Global $Button1, $ininame, $section, $key, $value, $ini $ini = GUICreate("Easy Ini Writer", 194, 274, 193, 115) $Group1 = GUICtrlCreateGroup("Ini File Name", 8, 8, 177, 49) $Input1 = GUICtrlCreateInput("", 18, 26, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Section Name", 8, 64, 177, 49) $Input2 = GUICtrlCreateInput("", 18, 82, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Key name", 8, 120, 177, 49) $Input3 = GUICtrlCreateInput("", 18, 138, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group4 = GUICtrlCreateGroup("Value", 8, 176, 177, 49) $Input4 = GUICtrlCreateInput("", 18, 194, 161, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Write Ini", 40, 232, 113, 33, 0) GUICtrlSetOnEvent(-1, "_ini") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $ini) GUISetState() While 1 Sleep(2000) WEnd Func Terminate() Exit EndFunc Func _ini() $ininame = @ScriptDir & "\" & GUICtrlRead($Input1) & ".ini" $section = GUICtrlRead($Input2) $key = GUICtrlRead($Input3) $value = GUICtrlRead($Input4) IniWrite($ininame, $section, $key, $value) Sleep(200) Terminate() EndFunc Edited July 21, 2007 by Golbez 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