lawonama Posted August 23, 2011 Share Posted August 23, 2011 I have the following code: $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Button IniWrite("C:\TKeybind\settings.ini", "Settings", "1", $text1) Case $Load IniRead("C:\TKeybind\settings.ini", "Settings", "1", $text1) EndSwitch WEnd But it wont work Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 23, 2011 Moderators Share Posted August 23, 2011 lawonama,But it wont workWhat does not work? Are you creating the ini file? Do you get the default value when loading? More info please! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ZacUSNYR Posted August 23, 2011 Share Posted August 23, 2011 What is $text1? Is it a GUI Input control? What are you doing with the read? You're suppose to get a return (and if it can't read it, it'll return whatever $text1 is.) Link to comment Share on other sites More sharing options...
lawonama Posted August 23, 2011 Author Share Posted August 23, 2011 (edited) $text1 = GuiCtrlCreateInput("", 10, 10, 290, 20) I have this. Im writing in the input for example : Hello. I press SAVE, and when I press LOAD it wont work. It doesn't make a .ini file. I tried to make the .ini file my self. But still it wont write inside. Its supposed to: Someone writes a text in $text1. When he presses the save button, it saves to the .ini file. When he presses the load button, it loads from the .ini file. Edited August 23, 2011 by lawonama Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 23, 2011 Moderators Share Posted August 23, 2011 lawonama,I suspect it is your OS not allowing you to write to the C:\ drive. Try changing the file path and see if you can write it elsewhere - best practice suggests that "C:\Users\your_name\AppData" is a good place. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
funkey Posted August 23, 2011 Share Posted August 23, 2011 Use GuiCtrlRead($text1) instead of $text1. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
lawonama Posted August 23, 2011 Author Share Posted August 23, 2011 You are right! It works.. but I wrote at the box : "Hello".. But in the Settings.ini I see: [settings] 1=5 I tried also : "asdsada" and its still [settings] 1=5 Anyone knows how to fix? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 23, 2011 Moderators Share Posted August 23, 2011 lawonama,Glad my suggestion worked. funkey has given you the answer to your new problem just above. You are currently saving the ControlID of the input, not the content. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
lawonama Posted August 23, 2011 Author Share Posted August 23, 2011 Hmm yes, it worked . But when I press load.. I dont see the :"Hello" in the box. It wont come there Link to comment Share on other sites More sharing options...
ZacUSNYR Posted August 23, 2011 Share Posted August 23, 2011 Try something like Case $Load $sSettings = IniRead("C:\TKeybind\settings.ini", "Settings", "1", "0") GUICtrlSetData($text1, $sSettings) Link to comment Share on other sites More sharing options...
lawonama Posted August 23, 2011 Author Share Posted August 23, 2011 Thanks! It worked. This topic can be closes. 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