ReadFileLines Procedure

Reads the contents of a file as a list of strings. Each line in the file is one string in the list. Use WriteFileLines to write a list of strings to a file.
Declaration
function ReadFileLines(filePath as String) as List of String

Parameters

Return value

List of String — The contents of the file, one string per line.

Possible error codes

Example

Code
WriteFileText "myfile.txt", "A" + NewLine + "B" + NewLine
dim lines = ReadFileLines("myfile.txt")
print Len(lines)
print lines(0)
print lines(1)
Output
2
A
B