Difference between revisions of "ADIR()"

From Lianjapedia
Jump to: navigation, search
(See Also)
 
(2 intermediate revisions by the same user 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==
Line 12: Line 12:
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!width="50%"|Character||width="50%"|Description
+
!width="25%"|Character||width="75%"|Description
 
|-
 
|-
 
|?||Matches any one character.
 
|?||Matches any one character.
Line 40: Line 40:
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!width="50%"|Letter||width="50%"|Attribute
+
!width="25%"|Letter||width="75%"|Attribute
 
|-
 
|-
 
|A||Archive (Read/Write)
 
|A||Archive (Read/Write)
Line 57: Line 57:
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!width="50%"|Flag||width="50%"|Case
+
!width="25%"|Flag||width="75%"|Case
 
|-
 
|-
 
|||Upper
 
|||Upper

Latest revision as of 13:02, 2 March 2022

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")