Re: [2005] Saving Variables
Use your applications settings. Search this forum for Application Settings.
Re: [2005] Saving Variables
You can save the variables in My.Settings and they will automatically be retrieved the next time the program starts.
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.
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.
Re: [2005] Saving Variables
How do i create them in the setting tab?
I type under value dim variable as whatever?
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.
Re: [2005] Saving Variables
nvm i understand the table is the spot where you set the variables, i didnt understand..lol
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
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.