Reading Files


INPUT - Function - Reads a number of characters from a file.
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.
GET - Read data from a text file into a record.


The most way to access a file is to 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


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext