LOTUSSCRIPT LANGUAGE


Dir function
Example

Returns file or directory names from a specified directory, or returns a drive volume label.

Syntax

Dir[$] [ ( fileSpec [ , attributeMask ] ) ]

Elements

fileSpec


attributeMask Return value

Dir returns a Variant of DataType 8 (String), and Dir$ returns a String.

Note On any platform except Windows (16, 9x, NT, 2000) if you ask for just the volume label you will get an empty string.

Usage

The constants in the table are defined in the file lsconst.lss. Including this file in your script allows you to use constant names instead of their numeric values.

To determine whether a particular file exists, use an exact file name for the file_spec argument to Dir or Dir$. The return value is either the file name or, if the file does not exist, the empty string ("").

The first call to Dir or Dir$ returns the name of the first file in the specified directory that fits the file name specifications in the fileSpec argument. Then:


If Dir or Dir$ is called without an argument after the empty string has been returned, LotusScript generates an error.

The Dir or Dir$ function may not be called recursively.

Example
See Also