Reading Files
You can read data from a file using either Input, Input # or Line Input #
INPUT - Statement - Reads a line as a series of variables with each variable seperated by a comma.
LINE INPUT - Reads a line as a series of variables with each variable seperated by a carriage return and line feed.
The most way to access a file is t assign it a unique file number.
You can read from a text file direct into an array
Function ExtractPath(sFullPath As String) As String
SpecLen = Len(Spec)
For I = SpecLen To 1 Step -1
If Mid(sFullPath,I,1) = "\" Then
ExtractPath = Left(sFullPath,I - 1)
Exit Function
End If
Next i
ExtractPath = ""
End Function
Alternatively you can use the InStrRev function.
Function ExtractPath(sFullPath As String) As String
ExtractPath = Left(sFullPath, InstrRev(sFullPath,"\") )
End Function
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext