Difference between revisions of "ADIR()"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) (→See Also) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
==See Also== | ==See Also== | ||
− | [[AADD()]], [[AAVERAGE()]], [[ACOPY()]], [[ADEL()]], [[ADESC()]], [[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]] | + | [[AADD()]], [[AAVERAGE()]], [[ACOPY()]], [[ADEL()]], [[ADESC()]], [[AELEMENT()]], [[AFIELDS()]], [[AFILES()]], [[AFILL()]], [[AINS()]], [[ALEN()]], [[AMAX()]], [[AMIN()]], [[APPEND FROM ARRAY]], [[ARRAY()]], [[ASCAN()]], [[ASIZE()]], [[ASORT()]], [[ASTORE()]], [[ASTRING()]], [[ASUBSCRIPT()]], [[ASUM()]], [[COPY TO ARRAY]], [[DECLARE]], [[DIMENSION]], [[DIR]], [[FDATE()]], [[FILE()]], [[GATHER]], [[IN_ARRAY()]], [[IS_ARRAY()]], [[LOCAL]], [[PRIVATE]], [[PUBLIC]], [[RELEASE]], [[RESTORE]], [[SAVE]], [[SCATTER]], [[SYSFILES]] |
==Description== | ==Description== | ||
The ADIR() function returns the number of files and/or directories which match the specified file skeleton and loads file information into the array <array>. The following 'wild card' characters can be used in the <skeleton>: | The ADIR() function returns the number of files and/or directories which match the specified file skeleton and loads file information into the array <array>. The following 'wild card' characters can be used in the <skeleton>: | ||
− | {| class="wikitable" width = 100% | + | {| class="wikitable" width="100%" |
− | !Character||Description | + | !width="25%"|Character||width="75%"|Description |
|- | |- | ||
|?||Matches any one character. | |?||Matches any one character. | ||
Line 22: | Line 22: | ||
If ADIR() returns a value greater than 0, the <array> will be created if it does not exist and resized if previously in existence. The ADIR() function will load the following information about the files/directories into the array: | If ADIR() returns a value greater than 0, the <array> will be created if it does not exist and resized if previously in existence. The ADIR() function will load the following information about the files/directories into the array: | ||
− | {| class="wikitable" width = 100% | + | {| class="wikitable" width="100%" |
− | !Column|| | + | !width="25%"|Column||width="25%"|Type||width="50%"|Contents |
|- | |- | ||
− | |1|| | + | |1||Character||Name |
|- | |- | ||
− | |2|| | + | |2||Numeric||Size |
|- | |- | ||
− | |3||Last modification date | + | |3||Date||Last modification date |
|- | |- | ||
− | |4||Last modification time | + | |4||Character||Last modification time |
|- | |- | ||
− | |5|| | + | |5||Character||Attributes |
|- | |- | ||
|} | |} | ||
Line 39: | Line 39: | ||
The attributes filter in <expC> can be any of the following: | The attributes filter in <expC> can be any of the following: | ||
− | {| class="wikitable" width = 100% | + | {| class="wikitable" width="100%" |
− | !Letter||Attribute | + | !width="25%"|Letter||width="75%"|Attribute |
|- | |- | ||
|A||Archive (Read/Write) | |A||Archive (Read/Write) | ||
Line 56: | Line 56: | ||
The flags <expN> parameter is determines the case of the file names returned. Note: on Linux/Mac this is parsed, but ignored. The file names are always returned in their original case. | The flags <expN> parameter is determines the case of the file names returned. Note: on Linux/Mac this is parsed, but ignored. The file names are always returned in their original case. | ||
− | {| class="wikitable" width = 100% | + | {| class="wikitable" width="100%" |
− | !Flag||Case | + | !width="25%"|Flag||width="75%"|Case |
|- | |- | ||
|||Upper | |||Upper | ||
Line 66: | Line 66: | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== |
Latest revision as of 13:02, 2 March 2022
Contents
Purpose
Function to return number of files and/or directories matching a file pattern and load file information into an array
Syntax
ADIR(<array> [, <skeleton> [, <expC> [, <expN>]]])
See Also
AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), AELEMENT(), AFIELDS(), AFILES(), AFILL(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, DIR, FDATE(), FILE(), GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER, SYSFILES
Description
The ADIR() function returns the number of files and/or directories which match the specified file skeleton and loads file information into the array <array>. The following 'wild card' characters can be used in the <skeleton>:
Character | Description |
---|---|
? | Matches any one character. |
* | Matches zero or more characters. |
If ADIR() returns a value greater than 0, the <array> will be created if it does not exist and resized if previously in existence. The ADIR() function will load the following information about the files/directories into the array:
Column | Type | Contents |
---|---|---|
1 | Character | Name |
2 | Numeric | Size |
3 | Date | Last modification date |
4 | Character | Last modification time |
5 | Character | Attributes |
The attributes filter in <expC> can be any of the following:
Letter | Attribute |
---|---|
A | Archive (Read/Write) |
H | Hidden |
R | Read only |
S | System |
D | Directory |
The flags <expN> parameter is determines the case of the file names returned. Note: on Linux/Mac this is parsed, but ignored. The file names are always returned in their original case.
Flag | Case |
---|---|
Upper | |
0 | Upper |
1 | Original |
Example
nTables = adir(aTables, "*.dbf")