WriteFileText Procedure
Creates or overwrites a text file with the contents of a string.
Use
ReadFileText to read the contents of a text file back into a string.
Declaration
sub WriteFileText(
filePath as String, text as String
)
Parameters
- filePath as String — Path and filename.
- text as String — The string to write to the file.
Possible error codes
- ERR_ACCESS_DENIED
- ERR_DISK_FULL
- 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