i want to read a file in in vb. i'm a little new to the syntaxt so hope you can help.
basically i want to open and read a file one line at a time. Each line that is read in is structure i.e. chars 0-15 are description 16-20 user code etc. How can i do this?
I have created an additional module with the following code however it doesn't seem to be findint he file. Am i doing something wrong?
Public Function OpenFile(f As String) As Boolean
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists(getFilename()) Then
Open getFilename() For Random As #1 Len = 200
fopen = True
OpenFile = True
fopen = False
OpenFile = False
Public Function ReadLine() As String
If fopen Then
Line Input #1, sBuffer
ReadLine = sBuffer
ReadLine = Null
where i read the value for the file in from the command line. (this is working as the string is correct that is being passed ( c:\test.txt ) )