Dir Function

Syntax:

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

Group:

File

Description:

 

Scan a directory for the first file matching Pattern$.

 

Parameter

Description

Pattern$

This string value is the path and name of the file search pattern. If this is omitted then continue scanning with the previous pattern. Each macro has its own independent search. A path relative to the current directory can be used.

AttribMask

This numeric value indicates which button is the default button. (Pressing the Enter key on a non-button pushes the default button.) Use -2 to indicate that there is no default button. Other possible values are shown the result table below. If this value is omitted then the first PushButton, OKButton or CancelButton is the default button.

 

 See Also:

GetAttr( ).

 

Example:


Sub Main
  F$ = Dir$("*.*")

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