Update cookies preferences
Promotic

FileTextRead - method of the Pm object

Description:
Reading the content of a text file to the value of the String type or the Array of strings.
Syntax:
Variant FileTextRead(String sFile, Long nType)
Parameters:
sFile(String) The file name with the path.
If a full path is not entered, then it is completed relative to the application folder.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files or folders.
nType(Long) Value of the parameter.
0 - Returns a value of the String type of the entire file content
1 - Returns the 1-dimensional array of the String type where each item of the array contains just one line of the file.
2 - Returns a value of the String type of the first line of the file.
3 - Returns a value of the String type of the last line of the file.
Caution: If the text file contains the "new line" character at the end, then this option returns an empty string corresponding to the last empty row.
Return value:
If reading the data failed then returns: null for JavaScript or Empty for VBScript (it can be tested by the Pm.IsValid method).
Note:
This method is not functional in Web panels.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var data = Pm.FileTextRead("#app:file.txt", 1);
if (Pm.IsValid(data))
{
Pm.Debug(data.GetItem(0));
}
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FileTextRead
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.