bcyde
February 28th, 2000, 05:35 PM
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
Lothar Haensler
February 29th, 2000, 01:24 AM
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
bcyde
February 29th, 2000, 03:32 PM
Thanks...