newtoau3 Posted June 18, 2007 Share Posted June 18, 2007 Hi guys, here's an easy one for you that I just dont know where to look...... In my GUI I have some input boxes, inputs get written to an .ini file - no problems there. What I cant seem to do is when the GUI is opened each time the "default" (previously inputted data), will not show up in the input boxes. Can you help me please? Sorry no script but I'm suspecting this can be done in 1 or 2 lines.... Thanks. Link to comment Share on other sites More sharing options...
PantZ4 Posted June 18, 2007 Share Posted June 18, 2007 If IniRead("C:/MyIniFile","Saved Data","CheckBox",0) = 1 Then GUICtrlSetState($MyCheckBox,$GUI_CHECKED) Link to comment Share on other sites More sharing options...
martin Posted June 18, 2007 Share Posted June 18, 2007 Hi guys, here's an easy one for you that I just dont know where to look......In my GUI I have some input boxes, inputs get written to an .ini file - no problems there. What I cant seem to do is when the GUI is opened each time the "default" (previously inputted data), will not show up in the input boxes.Can you help me please?Sorry no script but I'm suspecting this can be done in 1 or 2 lines....Thanks.Read the data with $string = IniRead($inifilename,$section,$variable,$defaultValue)write the data to the input box with GUICtrlSetData($EditBox,$string) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 18, 2007 Moderators Share Posted June 18, 2007 (edited) If IniRead("C:/MyIniFile","Saved Data","CheckBox",0) = 1 Then GUICtrlSetState($MyCheckBox,$GUI_CHECKED)You may find that this statement will never be true. IniRead() returns a string, you have it checking for an integer. Edit: (Besides the fact that "C:/MyIniFile" is incorrect ) Edited June 18, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
star2 Posted June 18, 2007 Share Posted June 18, 2007 (edited) can the script find out how many sections, keys, values in the ini file? for example this ini file [test section-1] test key-1 = test valu-1 [test section-2] test key-1 = test valu-2 [test section-3] test key-1 = test valu-3 I want the script to tell me the ini file has 3 sction and a MsgBox with Detail I just can't figure this out Edited June 18, 2007 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] Link to comment Share on other sites More sharing options...
GaryFrost Posted June 18, 2007 Share Posted June 18, 2007 can the script find out how many sections, keys, values in the ini file?IniReadSectionNames IniReadSection SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
star2 Posted June 18, 2007 Share Posted June 18, 2007 still didn't like the example in the help file maby cause I'm having a very bad Headache [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] Link to comment Share on other sites More sharing options...
newtoau3 Posted June 19, 2007 Author Share Posted June 19, 2007 Worked great, Martin, cheers! 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