$FILEPUT (output data to file)
$FILEPUT outputs data to a file.
Syntax
$FILEPUT(file-object,character-string)
Values
-
file-object
Specifies the file object of the file into which the data is to be output. Specify the variable name of the file object requested by the $FILEOPEN embedded function.
-
character-string
Specifies a character string to be output to a file, either as a constant or a variable. A constant must be enclosed in single quotation marks ('').
Status
The following table lists and describes the possible statuses:
Status |
Description |
---|---|
NORMAL |
Normal end |
NODATA |
— |
ERROR |
— |
Script execution interrupted |
Indicates one of the following:
|
Example
The following example creates the file output.csv, and outputs ABCDEFGHI as a single row:
[SET_VALUE] FH = $FILEOPEN('output.csv', RENEW) $FILEPUT(FH, 'ABC') $FILEPUT(FH, 'DEF') $FILEPUT(FH, 'GHI') $FILECLOSE(FH)
- Execution result:
-
The following is output to output.csv:
ABCDEFGHI