AFILES()

From Lianjapedia
Revision as of 06:19, 16 February 2018 by Barrymavin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to return number of files matching a file pattern and optionally load file information into arrays

Syntax

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

See Also

AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFIELDS(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, FDATE(), FILE(), GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER

Description

The AFILES() function returns the number of files which match the specified file skeleton. The following 'wild card' characters can be used:

Character Description
? Matches any one character.
* Matches zero or more characters.

The AFILES() function may also be used to load file information into arrays. If AFILES() returns a value greater than 0, the specified arrays will be created if they do not exist and resized if previously in existence.

Parameter Description
<skeleton> The character string specifying the file skeleton.
<array1> The name of an array in which to load the character string file names that match the specified skeleton.
<array2> The name of an array in which to load the numeric type file size in bytes of the files that match the specified skeleton.
<array3> The name of an array in which to load the date type creation date of the files that match the specified skeleton.
<array4> The name of an array in which to load the character type creation time of the files matching the specified skeleton.
<array5> The name of an array. This option has been added for compatibility purposes only. An element containing the character string "A" will be loaded for each file that matches the specified skeleton.

Example

nTables = afiles("*.*",afilenames)