ADIR( ) Function Example

The following example uses ADIR( ) to create an array containing database information. The names of the databases are then displayed.

CLOSE DATABASES
SET PATH TO (HOME(2) + 'Data')

gnDbcnumber = ADIR(gaDatabase, '*.DBC')  && Create array

CLEAR
FOR nCount = 1 TO gnDbcnumber  && Loop for number of databases
   ? gaDatabase(nCount,1)  && Display database names
ENDFOR
SET PATH TO HOME( )  && Set path to Visual FoxPro directory