Jump to content

Being able to store a variable permanently


Recommended Posts

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

Link to comment
Share on other sites

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 by argumentum
=)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Developers
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. 

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.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...