tags:

views:

335

answers:

1

I have a folder in c drive,whicn contain 1000 txt file,i want to get the list of all these txt file. How can i get this list?

+5  A: 

Use the OS-DIR() function.

For example:

DEFINE STREAM dirlist.
DEFINE VARIABLE filename AS CHARACTER FORMAT "x(30)" NO-UNDO.

INPUT STREAM dirlist FROM OS-DIR(".").

REPEAT:   
    IMPORT STREAM dirlist filename.
    DISPLAY filename.
END.

INPUT CLOSE.
Dave Webb