File operations

The following table describes the three kinds of files in LotusScript®: sequential, random, and binary.

File type

Description

Sequential

The simplest and most common. It is the equivalent of a common text file. Data in sequential files are delimited with the platform's end-of-line indicator (carriage return, line feed, or both). You can read the file with a text editor.

Random

The most useful for structured data. It is not readable except through LotusScript® programs. This is the default.

Binary

The most complex. It requires detailed programming to manipulate, because access is defined at the level of bytes on the disk.

To store and manipulate data in a file, the file must be opened first. When a file is opened in LotusScript®, it has a file number, between 1 and 255, which is used in most input and output operations. (A few file operations use the file name instead of a number.) The number remains until the file is closed.

Some file operations that can be performed on these files are:

Close

Close one or more open files.

Get, Input

Read data from a file.

Kill

Delete a file.

Open

Open a file.

Put, Write

Write data to a file.