What would be the best way to retrieve data from files, these files could include binary or ascii (and files range from small to very big), the following is the one i use but it doesn't seem to give the best quality.
------------------------------------------
file is the name of the files.
data is the data inside the file.
------------------------------------------
Open file For Binary As
#f data = Input(LOF(f), #f)
DoEvents
Close
#f------------------------------------------
Comments
To access a file, you would have to open it - which your example does, and you are getting data from the exact line of the file you want in your example...
Your example seems to be the best you can do in terms of accessing/retrieving the data.
: What would be the best way to retrieve data from files, these files could include binary or ascii (and files range from small to very big), the following is the one i use but it doesn't seem to give the best quality.
:
: ------------------------------------------
: file is the name of the files.
: data is the data inside the file.
: ------------------------------------------
: Open file For Binary As #f
: data = Input(LOF(f), #f)
: DoEvents
: Close #f
: ------------------------------------------
in terms of what i want, is to retrieve all info from the file.
: What do you mean by best quality?
:
: To access a file, you would have to open it - which your example does, and you are getting data from the exact line of the file you want in your example...
: Your example seems to be the best you can do in terms of accessing/retrieving the data.
:
: : What would be the best way to retrieve data from files, these files could include binary or ascii (and files range from small to very big), the following is the one i use but it doesn't seem to give the best quality.
: :
: : ------------------------------------------
: : file is the name of the files.
: : data is the data inside the file.
: : ------------------------------------------
: : Open file For Binary As #f
: : data = Input(LOF(f), #f)
: : DoEvents
: : Close #f
: : ------------------------------------------
:
:
: in terms of what i want, is to retrieve all info from the file.
Don't know how it compares in speed, but I typically use Put and Get with Binary mode.
Dim Data As String
Open file For Binary As 1
Data = String$(LOF(1), 0)
Get 1, , Data
Close
Always been fast enough for me...