satanttin Posted November 14, 2013 Posted November 14, 2013 Alloha, I have a little problem with saving variables to an .ini file. it works for normal entry's but not for variables i've done it before just forgot how. the thing is when i save data instead of data it puts numbers in there? the code for writing data is: IniWrite("Data Files\CoWorkers.ini", $IName, "Name", $IName) Hope someone can help me.
water Posted November 14, 2013 Posted November 14, 2013 The code you posted uses the same variable for the section name and the content of the key. Is this what you want? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ripdad Posted November 14, 2013 Posted November 14, 2013 That is not a true path. Where is "Data Files" ? "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward
water Posted November 14, 2013 Posted November 14, 2013 If you want to write to an Ini file in a subdirectory of the current directory use: IniWrite(@ScriptDir & "\Data Files\CoWorkers.ini", $IName, "Name", $IName) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 The code you posted uses the same variable for the section name and the content of the key. Is this what you want? yes this is what i want because i need to save more things to each coworker. @ripdad i use ISN autoit studio just the path is correct otherwise i can't even save numbers to it.
satanttin Posted November 14, 2013 Author Posted November 14, 2013 If you want to write to an Ini file in a subdirectory of the current directory use: IniWrite(@ScriptDir & "\Data Files\CoWorkers.ini", $IName, "Name", $IName) still only gives numbers to the .ini
water Posted November 14, 2013 Posted November 14, 2013 Can you post a working example? How do you save numbers? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 Func AddCoWorker() IniWrite("Data Files\Coworker.ini", $IName, "Name", $IName) IniWrite("Data Files\Coworker.ini", $IName, "Department", $Department) IniWrite("Data Files\Coworker.ini", $IName, "Age", $Age) GUISetState(@SW_SHOW, $Main) GUIDelete($AddNew) EndFunc This is the function i use to save to the .ini file. just instead of names it puts a 4 or stuff in it like below: [4] Name=4 Department=5 Age=6
water Posted November 14, 2013 Posted November 14, 2013 Looks like you write the ControlId and not the content of the Control? Can you please post all lines of your script where $IName is being used? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 $IName = GUICtrlCreateInput("Name",51,4,150,20,-1,512) the input where i can add coworkers. IniWrite("Data Files\coworker.ini", $IName, "Name", $IName) What u already saw. Global $IName $GName = $IName cause i think i need to save the input to another variable to print it somewhere on the screen
Solution water Posted November 14, 2013 Solution Posted November 14, 2013 Usually you have a button on the GUI (OK, Start, Save or whatever) to let the script process the users input. There you read the data of the controls and store it in a variable. Example: $sName = GUICtrlRead($IName) You then need to use this variable to write to the Ini file. IniWrite("Data Files\Coworker.ini", $sName, "Name", $sName) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 ahh that was it xD thanks i think that works ^^ been a while since i used this option didn't remembered u need to use guictrlread let u know if it works
satanttin Posted November 14, 2013 Author Posted November 14, 2013 It works like a charm many thanks :3
water Posted November 14, 2013 Posted November 14, 2013 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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