|
-
Apr 8th, 2002, 05:47 PM
#1
Thread Starter
Addicted Member
Create, Edit, and Rename text file
I need to create a text file out of nothing. How? Once that is created in a certain directory i want some variables placed in the file then have it renamed to a... .info i need to know how to create the text file then how to rename it. I know that you rename it using 'for' and 'as' but i dont know exactly how. THX
-
Apr 8th, 2002, 05:52 PM
#2
PowerPoster
Why does it need to be a txt file first, then renamed? Just use the following code:
VB Code:
Open App.Path & "\myfile.info" For Output As #1
Print #1, myVar1
Print #1, myVar2
Close #1
-
Apr 8th, 2002, 06:08 PM
#3
Thread Starter
Addicted Member
Problems with Quotes I have a line with quotes inside of it. It's XML. How do i deal with that. It also has variables within it. What would i need to do to fix this. It ends the quote on the second " can i use ( or { or [ s?
-
Apr 8th, 2002, 06:10 PM
#4
PowerPoster
I don't quite understand what you mean. To use quotes in a string you can either use """ triple quotes, I think, or the way I do it: SomeStringVar & Chr(34) & "SomeMoreText" & Chr(34). The Chr(34) is a " character.
-
Apr 8th, 2002, 07:00 PM
#5
PowerPoster
If there are quotes in the string you read from a file then the file was written using Write instead of Print.
VB Code:
Write #1, "NewHelp4Me"
Print #1, "NewHelp4Me"
In the first case the file will be like this:
"NewHelp4Me"
In the second case the file will be like this:
NewHelp4Me
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
|