Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Alternative to Open file


Message #1 by "Hong Wye Kean" <hwkean@h...> on Mon, 27 Aug 2001 11:47:36
If you need the read the text file in a string, why do not
read the whole file with a single get?

    Open pstrFile For Binary As InFile
    Dim str As String
    str = Space(LOF(InFile))
    Get InFile, , str
    Close InFile


-----Original Message-----
From: Hong Wye Kean [mailto:hwkean@h...]
Sent: Monday, August 27, 2001 4:48 AM
To: professional vb
Subject: [pro_vb] Alternative to Open file


Hello everyone,

I have a situation where my program will open up a file and read the 
contents into an array line by line. I am currently using the Open 
function to open the file, and redim preserve my array each time a line is 
read into the array.

The problem is, this process is too slow. I have checked into MSDN for 
another method to get the file content into an array but to no avail. Is 
this the only way?



Thanks

  Return to Index