d$() = Dir$({path$})

This command returns a string array which contains a list of files and directories in the given path.

Here is an example of how to display a list of all the files and directories:

dim d$(0)

Rem Get a list of files and directories in the root directory.
d$() = Dir$()

Rem Display a list of the results
List d$(), f$

Rem If the user selected a directory, List that directory.
if isDir(f$) Then
d$() = Dir$(f$)
List d$(), f$

Here is a method of listing only the directories in a dir list:

dim d$(0)
dim n(0)

d$() = Dir$()
n() = GetDim(d$())

For i = 0 to n(1)
If isDir(d$(i)) Then Print d$(i)
Next i





Become a Patron