|
-
Sep 27th, 2001, 10:51 AM
#1
Thread Starter
Fanatic Member
How do I assign a name to a saved file?
I am new to text file processing in VB. I am parsing a file that contains many reports. I wish to save each report as a separate text file. What is the syntax for that?
Thanks,
Jeff
-
Sep 27th, 2001, 10:55 AM
#2
Thread Starter
Fanatic Member
I should probably reword this.
After parsing the data I wish to save each report as a separate file. How do I save the text file in a specific directory and save it under a specific name?
-
Sep 27th, 2001, 11:06 AM
#3
Addicted Member
Code:
Dim FileNum as Integer
Dim FilePath as String
Dim FileName as String
Dim Data as String
Data = "Whatever data you wish to write"
FilePath = "C:\"
FileName = "DataFile1.dat"
FileNum = FreeFile
Open FilePath + FileName For Output as FileNum
Print #FileNum, Data
Close #FileNum
If you want to append to the file, replace the Output keyword with the Append keyword
-
Sep 27th, 2001, 11:12 AM
#4
Thread Starter
Fanatic Member
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
|