>Hi all,
>
>How can I use ADIR() or any other way to store in the array only the directory names.
>
>I am using the ADIR() function as follow :
>
> =ADIR(DIRARRAY,M.MYPATH+'\*','D')
>
>The problem is that I am getting the filenames also (not only the sub directories)
>
>Thanks in advance
Peter,
The only way to use ADIR() to return just directories is to set the default path to the desired directory. The "D" parameter is inclusive not exclusive. The documentation clearly states that you must pass an empty ("") string to retrieve only directories. When you add the path, it is not an empty string.
The data returned by ADIR() will always include the "." and ".." indicating the directory itself and its parent. Here's a sample of how to return just sub-directory.
lcpath = SYS(5) + SYS(2003)
SET DEFAULT TO (lcnewpath)
= ADIR(a_dir, "", "D")
SET DEFAULT TO (lcpath
George
Ubi caritas et amor, deus ibi est