Dir$ Function

Syntax

Dir[$]([Pattern$][, AttribMask])

Group

File

Description

Scans a directory for the first file matching Pattern$.

Sandbox

Sandbox mode blocks this function.

Parameters

Parameters Description
Pattern$ The path and name of the file search pattern. If this is omitted, continue scanning with the previous pattern. Each macro has its own independent search. A path relative to the current directory can be used.
AttribMask Controls which files are found. A file with an attribute that matches is found.

See also

GetAttr( )


Sub Main
    F$ = Dir$("*.*")
    While F$ <> ""
        Debug.Print F$
        F$ = Dir$()
    Wend
End Sub