Lempke Posted September 18, 2006 Posted September 18, 2006 (edited) I want to read a value from a ini file which will appear in a GUI. I want to be able to change the value in the GUI and the write it back to the ini file. I can't seem to get it working. This is a portion of my script: $FirstName = IniRead("C:\Lempke\USER.ini", "USERDATA", "FirstName", "") GUICtrlCreateLabel("FirstName", 25, 35, 100, 20) $FirstName = GuiCtrlCreateInput("" & $FirstName, 120, 30, 200, 20) ........ ........ ........ GuiSetState() While 1 $msg = guigetmsg() ......... ......... ......... GUICtrlRead($FirstName) IniWrite("C:\Lempke\USER.ini", "USERDATA", "FirstName", $FirstName) ......... ......... ......... It only returns the ControlID. I don't know whats wrong...please help Edited September 18, 2006 by Lempke
FuryCell Posted September 18, 2006 Posted September 18, 2006 (edited) GuiCtrlRead() just stores the returns the value so you need to store it in a variable or pass it directly to IniWrite. A. Store In Variable $Value=GUICtrlRead($FirstName) IniWrite("C:\Lempke\USER.ini", "USERDATA", "FirstName", $Value) Edited September 18, 2006 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Lempke Posted September 18, 2006 Author Posted September 18, 2006 (edited) GuiCtrlRead() just stores the returns the value so you need to store it in a variable or pass it directly to IniWrite. A. Store In Variable $Value=GUICtrlRead($FirstName) IniWrite("C:\Lempke\USER.ini", "USERDATA", "FirstName", $Value) I thought that I had tried option B and that it didn't work, but it works fine. Also option A works fine. THX SolidSnake Edited September 18, 2006 by Lempke
FuryCell Posted September 18, 2006 Posted September 18, 2006 I thought that I had tried option B and that it didn't work, but it works fine. Also option A works fine.THX SolidSnakenp. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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