|
-
Mar 15th, 2008, 09:13 AM
#1
Thread Starter
Frenzied Member
[2005] Saving Variables
Hello, how do i make it so whenever a user closes the program it saves the values of all the variables so if the user changes a setting or types in his name it will recanize it next time the program is opened instead of setting the vvariables to their deafult settings. If i have to save a ini file or somethine how is this done?
-
Mar 15th, 2008, 09:52 AM
#2
Re: [2005] Saving Variables
Use your applications settings. Search this forum for Application Settings.
-
Mar 15th, 2008, 09:58 AM
#3
Frenzied Member
Re: [2005] Saving Variables
You can save the variables in My.Settings and they will automatically be retrieved the next time the program starts.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Mar 15th, 2008, 12:32 PM
#4
Thread Starter
Frenzied Member
Re: [2005] Saving Variables
Hello i know about My.Settings but how exactly do i use my.settings i read something abotu it but i dont quite understand. How do i choose which variables are saved? do i set it as a string and the value as the variable name in settings? Please explain how my.settings works or how i can save it/load it.
-
Mar 15th, 2008, 02:01 PM
#5
Frenzied Member
Re: [2005] Saving Variables
You need to create the variables in the Settings tab in your project properties, and then just write My.Settings.[name of variable] and use it as a normal variable.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Mar 15th, 2008, 05:36 PM
#6
Thread Starter
Frenzied Member
Re: [2005] Saving Variables
How do i create them in the setting tab?
I type under value dim variable as whatever?
-
Mar 15th, 2008, 05:41 PM
#7
Frenzied Member
Re: [2005] Saving Variables
In the settings tab, write the desired variable name in the Name column, then pick the type you want the variable to be, then pick a scope, and finally write the desired initial value of the variable in the Value column.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Mar 15th, 2008, 05:44 PM
#8
Thread Starter
Frenzied Member
Re: [2005] Saving Variables
nvm i understand the table is the spot where you set the variables, i didnt understand..lol
-
Mar 15th, 2008, 05:47 PM
#9
Thread Starter
Frenzied Member
Re: [2005] Saving Variables
I mean i didnt understand the time i wrote the question asking where you write it..lol So these are going to be saved everytime the program shutsdown. Cant i also use this as a way to set global variables? then say if i dont want them to save i just add a bit of extra code that resets it.
Thankyou
-
Mar 16th, 2008, 02:38 AM
#10
Frenzied Member
Re: [2005] Saving Variables
You're welcome. Could you explain a bit more, what do you mean 'global variables'? The variables in My.Settings (as long as they're set to User scope) are accessible from anywhere, and as for not saving them, I think there was a property, something like My.MySettings.SaveOnExit or so that you can change in order to specify whether you want them to save on exit or not. Check out the My proxy, you'll find some very useful stuff there.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|