PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > DIRLIST command
DIRLIST command

 Gets the contain of a Windows directory.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('DIRLIST')

CHGVAR

VAR(&PARM1) VALUE('
[;Pattern="Files to list"]
[;Path="Path to directory"]
[;First= True / False ]
[;Close= True / False ]
[;SubDir= True / False ]
[;Hidden= True / False ]
')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

or

Parm2

 

 

 

 

 

 

 

 

 

 

 

RESULT

Pattern= : Allows to set the type of files we want to list.
Example : Pattern="*.doc"
Keyword « Pattern » can also include the directory path.
Example : Pattern ="\\FileServer\Docs\*.doc"

Path= : The directory path, if it is not included in Pattern.
Example : Path="\\FileServer\Docs"; Pattern="*.doc"

First=True to start listing at the beginning of the directory. If First is false, command returns the next entry in the directory.

Close=True to close the directory listing.

SubDir=True to list only the sub directories contained into the specified directory. The files are not listed.

Hidden=True to list also the hidden files.

 

 

On each call, a file name is returned into the &RESULT parameter.
If the list is empty, or the last file listed, &RESULT is empty.

Each file returned in &RESULT has the following format:

     Positions 1 to 256 : File name.

     Position 257 : ‘N’. Letter ‘N’ is present if the entry is not empty.

     Position 258 : ‘A’. If the file has ‘Archive’ attribute.

     Position 259 : ‘H’. If the file name is hidden.

     Position 260 : ‘R’. If the file is read only.

     Position 261 : ‘D’. If the entry is a sub directory.

     Position 262 : ‘S’. If it is a system file.

 

 

Example

 

CHGVAR

VAR(&CMD) VALUE('DIRLIST')

CHGVAR

VAR(&PARM1) VALUE('Pattern="*.xls";Path="N:\DOCS"')

CHGVAR

VAR(&PARM2) VALUE('First=True')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)