OPENDIR() (not included in filePro Lite)

 

Syntax:

 

N = opendir(format type, filename)

N = opendir()

no format type, no filename - Creates a list of all filePro files.

N = opendir("PRC_MASK")

Creates a list of all prc files for the current file.

N = opendir("SCR_MASK", "fpcust")

Creates a list of all screens for the fpcust file.

N = opendir("*.htm")

Creates a list of all *.htm screens in the current files directory.

 

The preset terms that the OPENDIR() function understands are as follows.

 

Mask:

Windows:

UNIX:

PRC_MASK 

.prc

Prc.*

TOK_MASK 

.tok

Tok.*

SCR_MASK 

screen.*

Screen.*

IDX_MASK 

index.*

Index.*

BRW_MASK 

.brw

Brw.*

OUT_MASK 

.out

Out.*

SEL_MASK 

.sel

Sel.*

HTML_SCR_PRC_MASK

scr*.prc

prc.scr*

HTML_SCR_TOK_MASK

scr*.tok

tok.scr*

HTML_BRW_PRC_MASK

brw*.prc

prc.brw*

HTML_BRW_TOK_MASK

brw*.tok

tok.brw*

 

Version Ref:  4.8

 

Description:

OPENDIR() allows you to do the equivalent of a DOS "DIR" or UNIX "ls" command. It returns the number of files in a filePro directory that meet the criteria.

 

Version 6.0.01

NEW command OPENDIR2 to handle long-named files and paths.

e.x.

N = OPENDIR2(mask, path, fmt_sz, ext_sz, nam_sz)

All arguments are optional.

 

Returns the number of files which match the parameters. If no parameters are given, a count of all filePro filenames is returned. If only a mask is specified, it is applied to the current filePro file. There are pre-defined masks for filePro files, but any mask may be used. Only one OPENDIR() or OPENDIR2() may be active at one time.

mask - the filter applied to the directory, same as OPENDIR()

path - the directory to use

fmt_sz - the total size to use to store the format (default 32)

ext_sz - the size used to store the extension (default 10)

nam_sz - the size used to store the filename (default 32)

Note: the numbers used to define the lengths change the size used by the system controlled "@DIRLIST" arrays.