LOTUSSCRIPT LANGUAGE


Write # statement
Example

Writes data to a sequential text file with delimiting characters.

Syntax

Write #fileNumber [ , exprList ]

Elements

#fileNumber


exprList
Usage

Use Write # only with files opened for either Output or Append.

Use the Input # statement to read data written by Write #.

Write # ignores the file width set by the Width # statement. Data items are separated with commas, and a newline character is inserted after all data has been written to the file.

LotusScript inserts "chr(10)" to represent the newline character in any multi-line string (for example, a string that you type in using vertical bars or braces). If you Print the string to a file, this newline character will be translated into the platform-specific newline character(s). If you Write the string to a file, no translation is done.

Note Newline does not mean either chr(10) or chr(13) on all platforms. Newline is the character or sequence of characters that is used to mark the end of a line. This may be chr(10), or chr(13), but it may also be something else, because the actual value of newline depends on the platform.

Note When reading a multiline string from a sequential file written by the Write # statement, use Input, not Line Input.

The following table shows how the Write # statement behaves with various data types specified in exprList.

Data typeWrite # statement behavior
NumericOmits leading and trailing spaces.
StringEncloses all strings in double quotation marks. Pads fixed-length strings with spaces as needed.
Variant of DataType 7 (Date/Time)Uses one of the following date formats:

#yyyy-mm-dd hh:mm:ss#

#yyyy-mm-dd#

#hh:mm:ss#

If either the date part or the time part is missing from the value, LotusScript writes only the part provided to the file.

Variant with the value EMPTYWrites a comma without data to the file. If that variable is the last item on the line, the comma is omitted.
Variant with the value NULLWrites the string NULL to the file.

Example
See Also