View Single Post
Old Aug 27th, 2004, 9:10 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
If you are needing to save a variable to disk as a file, add this function to your project (cut & paste) and then use the example below for how to call it.

Private Function SaveFile(txtFile, ByVal MyText As String)
  Dim FileNum As Integer

  FileNum = FreeFile()

  Open txtFile For Output As FileNum
  Print #FileNum, MyText;
  Close FileNum
End Function
Say your variable containing data you want saved was named
strVarA

You would use like so:
SaveFile "D:\File.txt", strVarA

You do not need to use a variable in place of strVarA, you can just put the text you want to save inside of quotes.

SaveFile "D:\File.txt", "This is the contents of File.txt"
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote