|
-
Nov 28th, 1999, 08:49 PM
#1
Thread Starter
Member
Hello, I search for code to read and write text file. I want to open large files(100K +) and then read them and in the end write them back to files.
Thank you very much,
Kiron
-
Nov 28th, 1999, 09:32 PM
#2
Reading and writing to text files is easy...
Stick this code in a module and have done with it!!
Code:
Option Explicit
Function OpenFile(Filename As String) As String
On Error Resume Next
Open Filename For Input As #1
OpenFile = Input(LOF(1), 1)
Close #1
End Function
Sub SaveFile(Filename As String, Text As String)
On Error Resume Next
Open Filename For Output As #1
Print #1, Text
Close #1
End Sub
As for using text files bigger than 100K, you'll have to use a more chunky text box than the one that comes with VB, as that only handles strings upto 64K (I think).
------------------
Matthew Ralston
E-Mail: [email protected]
ICQ:31422892
Web Sites:The Blue Link My Home Page
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
|