A WRITE statement may also be used to write information to a file or to the dialog area, instead of to the document itself. For this, you must first open a file in OUTPUT mode using the OPEN statement.
To write a string message to the file use the following syntax:
where fl is the file pointer to which you want to write the messages.