ReadFileText Procedure
Reads the contents of a file as a string.
Use
WriteFileText to write a string to a file.
Declaration
function ReadFileText(filePath as String) as String
Parameters
- filePath as String — Path and filename.
Return value
String — The contents of the file.
Possible error codes
- ERR_ACCESS_DENIED
- ERR_FILE_NOT_FOUND
- ERR_IO_FAILURE
- ERR_PATH_IS_DIRECTORY
- ERR_PATH_TOO_LONG
Example
Code
WriteFileText "myfile.txt", "Hello!"
print ReadFileText("myfile.txt")
Output