|
-
Oct 11th, 2003, 10:46 PM
#1
Thread Starter
Junior Member
Saving to a text file
I need to save the values of several variables to a text file can somebody please give me an example of the code used to save the variables named (var1, var2, var3, var4, var5) to a text file and then retrieve them.
-
Oct 11th, 2003, 11:10 PM
#2
PowerPoster
the "sandbox" project at the link below my name show how to read and write text files
-
Oct 12th, 2003, 11:38 PM
#3
Lively Member
Code:
On Error GoTo fileerror
' creates a file if one is not made
'and writes what is in text box, output overwrites and append adds to
Open "c:\text.txt" For Append As #1
Print #1, Text1.Text
Close #1
Exit Sub
fileerror:
MsgBox "file error"
take this code and change the print line to your variable. ie..
Print #1, var1
and so on
good luck
R.L.T.W. A+, NET+, CCNA
Doin' my best
-
Oct 12th, 2003, 11:47 PM
#4
Alternatly:
You may want to investigate .ini files or the Registry to save and retrieve data.
Bruce.
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
|