Promotic
WikipediaLinkedInYoutubeTwitterFacebook

FileTextRead - method of object Pm

Description:
Reading the content of the text file into the String type or the Array of strings.
Syntax:
FileTextRead(sFile As String, nType As Long) As Variant
Calling:
val = Pm.FileTextRead(sFile, nType)
Parameters:
sFile(String) file name (with the path). If a full path is not entered, it is completed relatively according to the application file folder.

It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.

nType(Long) Value of the parameter
0 - Returns String of the content of the entire file
1 - Returns the 1-dim. array of the String type where each item of the array contains just one line from the file.
2 - Returns String of the first line of the file.
3 - Returns String of the last line of the file.

Warning: if the text file contains the "end of line sign", then this option returns an empty String corresponding to the last empty row.

Return Values:
If the operation failed, the method returns the Null value (it can be tested by the Pm.IsValid method).
Note:
This method is not functional for Web Panels.
Example:
Dim data
data = Pm.FileTextRead("#data:file.txt", 1)
If Pm.IsValid(data) Then
  Pm.Debug data(0)
End If
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FileTextRead
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice