|
-
February 28th, 2000, 06:35 PM
#1
Loading a text file into memory
I was just wondering if I there was a way to load a file into memory where I could perform all file operations on it there and then save it back over the original file when I am ready. Is it possible to load a file to memory in VB and do something like this?
Thanks
-
February 29th, 2000, 02:24 AM
#2
Re: Loading a text file into memory
you could load the complete file contents into a string:
Dim hfile as Integer
hfile = FreeFile
Dim strInput as string
Dim lLen as Long
Dim strfile as string
strfile = "c:\test.htm"
lLen = FileLen(strfile)
strInput = string(lLen, " ")
Open strfile for binary as #hfile len = lLen
get #hfile, , strInput
Close #hfile
Debug.print strInput
...and manipulate the string contents afterwards
-
February 29th, 2000, 04:32 PM
#3
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
|