|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
storing variables to a file
Hi
I am writing a vb app (No suprises there) and i want to store a few (string) variables in a file so that when i exit the program and start it again the data is put back in those variables. what is the easiest/best way to do this? |
|
#2
|
||||
|
||||
|
why don't you just write out an .ini file? You can output one just like a text file, with
Open blah.ini for output as #1 and then just write out your variables. You could do it in simple ini format, where you have headers... [x] value=1 [y] value=2 ... or you could just do it by examining your input stream and looking for line breaks. Hope this helps |
|
#3
|
||||
|
||||
|
you can also use the registry for this.
|
|
#4
|
|||
|
|||
|
thanks for the fast reply
the registry is not suitable for the program i am making because the variables may need to be passed between computers i know that, to input and output data, i use: OPEN file.dat for INPUT as #1 input #1, variable close #1 i have a few more questions. what is the best input mode? what are the best commands to use with this input mode? if the values change while the program is running should i update the file by deleting the whole lot and creating a new one or should i do it properly? Thanks, RIchard |
|
#5
|
||||
|
||||
|
hey Richard....
I hope these help... I recently had to use ini files, and used some of these... http://www.programmersheaven.com/zone1/cat376/ http://www.mentalis.org/apilist/Wri...ileString.shtml if not.. then I would suggest googling for " using ini files visual basic "
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > storing variables to a file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|