file text open

Allows you to open a text file for writing.

Format:

 
file text open
file_name =
string
open_mode =
open_mode

Example:

 
file text open &
file_name =
"c:\data.txt" &
open_mode =
append

Description:

 
Parameter
Value Type
Description
file_name
String
Specifies the name of the input or output text file.
open_mode
Open_mode
Specifies the mode in which the file is to be opened, thereby determining which operations are valid for this file. Available values are: APPEND and OVERWRITE.

Extended Definition:

1. Depending upon the open_mode the file can either be overwritten completely or appended.
2. You may use the file_name later in file text write or file text close commands to indicate which file you wish to operate upon.
The proper extension for file_name parameter is the default (.txt) but can be overridden simply by supplying a different extension.
You do not need to enclose the file name in quotes if it only contains alpha-numeric characters and starts with a letter. If you want to include other characters, such as a '.' for an extension or '/' or '[]' for directory paths, you must enclose the name in quotes.
3. If the file is opened with open_mode=OVERWRITE, any existing file with the name given in the file_name parameter is deleted at the time of the OPEN. If the file is opened with open_mode=APPEND, then any existing file is appended by subsequent WRITEs (the file need not exist for the APPEND mode to work).