[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ADIR()

    ADIR() fills a series of arrays with directory information including
    filenames and/or return the number of files matching a skeleton.

Syntax

    ADIR(<directory skeleton>[,<array1>[,<array2>[,<array3>
          [,<array4>[,<array5]]]]])

Arguments

    <directory skeleton> is a wildcard pattern of files.  The standard
    wildcard characters (* and ?) are supported.  The default is "*.*"

    <array1> is the name of the array to fill with the filenames matching
    the directory skeleton.  Each element is character type.

    <array2> is the array to fill with the sizes of the corresponding files
    in <array1>.  Each element is numeric type.

    <array3> is the array to fill with the dates of the corresponding files
    in <array1>.  Each element is date type.

    <array4> is the array to fill with the times of the corresponding files
    in <array1>.  Each element is character type.

    <array5> is the array to fill with the attributes of the corresponding
    files in <array1>.  Each element is character type.  The possible
    values returned are as follows:

                    Attributes of Files Returned by ADIR()
    Symbol       Description
      R          Read only
      H          Hidden
      S          System
      D          Directory
      A          Archive

    Note that if <array5> is specified, hidden, system, and directory files
    are included as well as normal files.  If <array5> is not specified
    only normal files are included.

Returns

    An integer numeric value.

    ADIR() returns the number of files matching the specified directory
    skeleton.  If the optional array name is included, elements of the
    array are filled with one filename per element until all matching files
    have been found or all of the elements have been used.

Usage

    ADIR() is useful as a tool for building file selectors and directory
    maintenance routines.  To create a file list array, you must DECLARE an
    array and then fill it with the necessary filenames.  The best way to
    do this is to first use ADIR() as the number of elements argument in
    the DECLARE statement.  For example:

    DECLARE dbf_files[ADIR("*.dbf")]

    Then sometime later, fill the array using the directory skeleton.

    To fill arrays for some attributes while ignoring others, pass a dummy
    variable.  For example, to obtain only the filenames and corresponding
    file dates:

    dbf_count = ADIR(*.dbf")                         
    DECLARE dbf_files[dbf_count], dbf_date[dbf_count]
    dummy = ""                                       
    ADIR(dbf_file, dummy, dbf_date)                  

See Also: ACHOICE ACOPY ADEL AFIELDS AFILL AINS ASCAN ASORT
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson