Dsmoeg999 Posted May 19, 2023 Posted May 19, 2023 Hi guys I understand that our variables are temporary they are stored in memory while we execute our program but I would like to know if there is a way to make our generated variable to be stored constantly. For example to be able to close our program and when we open it again remember the value we put in the variable. An example would be. Generate a random number after closing our program open it again. and to be able to show the value of the number that we want to store. #include <MsgBoxConstants.au3> Example() Func Example() $number1= Random(1, 6, 1) ;here we generate our first value Global Const $number = $number1 ;We save the value to remember it MsgBox($MB_SYSTEMMODAL, "", "The number generated is : " & $number1) MsgBox($MB_SYSTEMMODAL, "", "The number saved is : " & $number) ; This is the number I want it to save and remember after I close the program and reopen it. EndFunc ;==>Example I hope you understand what I want to do, could you tell me if it is possible to do this? Thanks
Subz Posted May 19, 2023 Posted May 19, 2023 Save the variable to either registry or ini file and then have your script re-read it on loading.
Dsmoeg999 Posted May 19, 2023 Author Posted May 19, 2023 Could you show an example of how it is done?
Developers Jos Posted May 19, 2023 Developers Posted May 19, 2023 Did you check out the helpfile examples first? 😉 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.
Popular Post Werty Posted May 19, 2023 Popular Post Posted May 19, 2023 1 minute ago, Dsmoeg999 said: Do you provide more than just comments ? He also provide Bans. BigDaddyO, water, argumentum and 5 others 8 Some guy's script + some other guy's script = my script!
argumentum Posted May 19, 2023 Posted May 19, 2023 (edited) 6 hours ago, Dsmoeg999 said: I hope you understand what I want to do IniWrite() PS: In this post you say you want to improve your skills as a programmer. Do read the help file. It'll help. Edited May 19, 2023 by argumentum =) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Developers Jos Posted May 19, 2023 Developers Posted May 19, 2023 45 minutes ago, Dsmoeg999 said: Do you provide more than just comments ? 😉 This basically sums it up: You aren't clearly putting in any effort for anything before posting. Musashi 1 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.
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