Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_dirtoa() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_DIRTOA()

 DESCRIPTION

 The C_DIRTOA() function finds all of the specified matching files
 on a current drive and builds an array of the file name, size,
 date, and time which can be used for display.  Optionally, the
 array can be built with only the file name.  The file specification
 can be one character string ("*.*") or an array of many
 specifications, including different file types across multiple
 directories.

 SYNTAX

 C_DIRTOA(filespec [,array] [,complete_list] [,shift])

 PARAMETERS

 filespec (C) is the file specification used to build the directory
 array.  This can be specified as a  string ("*.*") or as an array
 where each element in the array contains a separate file specification.

 array (A) is the array to fill with directory entries.  The array
 must be declared to the correct size before this function is called
 with the array argument and must be specified without quotes
 (ARRAY).  If array is not specified, C_DIRTOA() returns the number
 of entries found matching the file specifications.  If array is
 specified, the array is filled with the entries.

 complete_list (L) indicates whether the array should be filled with
 only the file name or with the file name, size, date, and time.
 Specify true (.T.) to include the file name, size, date, and time
 in the array, or false (.F.) to include only the file name.  If the
 complete_list argument is not specified, only the file name will be
 included.

 shift (L) indicates whether the file names in the array should be
 shifted left to eliminate the space before the name.  This produces
 an array suitable for the C_BACKUP() function.  Specify true (.T.)
 to shift the names left (for C_BACKUP) or false (.F.) to include a
 space.  If shift is not specified, the default of false (.F.) is used.

 RETURNS

 C_DIRTOA() returns the number of matching files found based on the
 file specifications.

 EXAMPLES

 && Fills array a1[] with name, size, date, and time of all files in
 && the current && directory.
 declare a1[ c_dirtoa("*.*") ]     && Declare array for correct size
 c_dirtoa("*.*",a1,.t.)

 && Fills array a1[] with only the file name of all files matching
 && (*.dbf, *.dbt, or *.ntx) suitable for the C_BACKUP() function
 declare f1[2]
 f1[1] = "*.DBF"      && Use three file specs for array
 f1[2] = "*.DBT"

 declare a1[ c_dirtoa(f1) ]     && Declare array for correct size
 c_dirtoa(f1,a1,.f.,.t.)        && Fill array with names (shifted left)


See Also: C_FINDFILE() C_FINDFIRST() C_ATOCHAR() C_BACKUP()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson