FINDOPEN

Top  Previous  Next

Syntax

UINT = FINDOPEN(dir as STRING)

Description

Opens a directory for reading filenames.

Parameters

dir - The directory to iterate filenames. Use wildcards to limit returned names.

Return value

Handle to open directory or 0 if the directory could not be opened for reading

Remarks

dir is a string the contains the full path to the directory plus any wildcard symbols for file matching. Example: "c:\\windows\\*.txt". Use *.* to retrieve a list of all the files.

See Also: FINDNEXT, FINDCLOSE

Example usage

OPENCONSOLE
DEF dir:UINT
DEF filename:STRING
 
dir = FINDOPEN("c:\\*.*")
IF(dir)
    DO
        filename = FINDNEXT(dir)
        PRINT filename
    UNTIL filename = ""
    FINDCLOSE dir
ENDIF
 
PRINT "Press Any Key"
DO:UNTIL INKEY$ <> ""
 
CLOSECONSOLE
END