Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > Dir FunctionThe standard VB function Dir returns a filename that matches the specified pattern, having the specified attributes. SyntaxDir[$] [(pathname[, attributes])]
ReturnsThe first filename that matches the pathname argument and has the specified attributes. Use the following integer values for attributes to return the specified type of file. NOTE: The values in the table can be added together to select multiple attributes. For example, to list hidden and system files in addition to normal files, set attributes to 6 (6 = 2 + 4). If attributes is set to 8, the Dir function returns the volume label of the drive specified in the pathname argument, or of the current drive if a drive is not explicitly specified. UsagePathname can include a drive specification and wildcard characters (? and *). A null string ("") passed as pathname is interpreted as the current folder (the same as "."). To retrieve additional matching filenames, call the Dir function again, omitting the pathname and attributes arguments. If no file is found, a null string ("") is returned. The dollar sign ($) in the function name is optional. If it is included, the return type is string. Otherwise, the function returns a variant of vartype 8 (string). ExampleThis example lists the contents of the diskette in drive A. Sub Button_Click ReDim A(100) See AlsoChDir Statement |
Siebel VB Language Reference |