4D v13.4

DOCUMENT LIST

Home

 
4D v13.4
DOCUMENT LIST

DOCUMENT LIST 


 

DOCUMENT LIST ( pathname ; documents {; options} ) 
Parameter Type   Description
pathname  String in Pathname to volume, directory or folder
documents  Text array in Names of the documents present at this location
options  Longint in Options for building list

The DOCUMENT LIST command populates the Text array documents with the names of the documents located at the location you pass in pathname.

Note: You must pass an absolute pathname in the pathname parameter.

By default, if you omit the options parameter, only the names of documents are returned in the documents  array. You can modify this by passing, in the options parameter, one or more of the following constants, found in the System Documents theme:

Constant Type Value Comment
Absolute path Longint 2 The documents array contains absolute pathnames
Ignore invisible Longint 8 Invisible documents are not listed
Posix path Longint 4 The documents array contains Posix format pathnames
Recursive parsing Longint 1 The documents array contains all files and subfolders of the specified folder

Notes:

  • With the Recursive parsing option in relative mode (option 1 only), the paths of documents located in subfolders begin with the ":" or "\" characters depending on the platform.
  • With the Posix path option in relative mode (option 4 only), paths do not start with "/".
  • With the Posix path option in absolute mode (option 4 + 2), paths always begin with "/".

If there are no documents at the specified location, the command returns an empty array. If the pathname you pass in pathname is invalid, DOCUMENT LIST generates a file manager error that you can intercept using an ON ERR CALL method.

List of all documents in a folder (default syntax):

 DOCUMENT LIST("C:\\";arrFiles)

-> arrFiles:
        Text1.txt
        Text2.txt

List of all documents in a folder in absolute mode:

 DOCUMENT LIST("C:\\";arrFiles; Absolute path)

-> arrFiles:
        C:\Text1.txt
        C:\Text2.txt

List of all documents in recursive (relative) mode:

 DOCUMENT LIST("C:\\";arrFiles;Recursive parsing)

-> arrFiles:
        Text1.txt
        Text2.txt
        \Folder1\Text3.txt
        \Folder1\Text4.txt
        \Folder2\Text5.txt
        \Folder2\Folder3\Picture1.png

List of all documents in recursive absolute mode:

 DOCUMENT LIST("C:\\MyFolder\\";arrFiles;Recursive parsing+Absolute path)

-> arrFiles:
        C:\MyFolder\MyText1.txt
        C:\MyFolder\MyText2.txt
        C:\MyFolder\Folder1\MyText3.txt
        C:\MyFolder\Folder1\MyText4.txt
        C:\MyFolder\Folder2\MyText5.txt
        C:\MyFolder\Folder2\Folder3\MyPicture1.png

List of all documents in recursive Posix (relative) mode:

 DOCUMENT LIST("C:\\MyFolder\\";arrFiles;Recursive parsing+Posix path)

-> arrFiles:
        MyText1.txt
        MyText2.txt
        Folder1/MyText3.txt
        Folder1/MyText4.txt
        Folder2/MyText5.txt
        Folder2/Folder3/MyPicture1.png

 
PROPERTIES 

Product: 4D
Theme: System Documents
Number: 474

This command modifies the Error system variable

 
INDEX

Alphabetical list of commands

 
HISTORY 

New
Created: 4D v6
Modified: 4D v13

 
SEE ALSO 

FOLDER LIST
VOLUME LIST