Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> files() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    FILES()

Purpose:     Test for the existence of multiple files in one function.

Syntax:      FILES( filename [, filename...filename ] )

Arguments:   filename    - Character string or variable of the file to
                           test for existence.

Returns:     True if all the specified files exist.

Description: FILES() is a file function that tests for the existence of
             multiple files.  It is useful for reducing a series of FILE()
             functions .AND.ed together into a single function call.  If
             you have to test for more than one file often, this really
             cleans things up and makes code very readable.

Notes:       FILES() will accept as many file name arguments as Clipper
             will allow you to pass.  A practical limit of the number of
             filenames which can be passed should be 10.  FILES() uses the
             Clipper FILE() function to successively test for each file
             specified.  If any test fails, FILES() returns False.  Since
             the FILE() function is used, it follows Clippers current SET
             DEFAULT setting.

             If FILES() encounters a non-character argument, it will fail,
             set RLIBERROR() and return False.

Example:     *-- see if all needed index files exist
             USE Sales

             IF FILES( "Custno.ntx",   "Invoice.ntx",;
                       "Salesman.ntx", "Repair.ntx",;
                       "Saledate.ntx" )
                SET INDEX TO Custno, Invoice, Salesman, Repair, Saledate
             ELSE
                *-- do indexing
             ENDIF

             *-- the old way to do it
             IF FILE("Custno.ntx"  ) .AND.  FILE("Invoice.ntx") .AND.;
                FILE("Salesman.ntx") .AND.  FILE("Repair.ntx" ) .AND.;
                FILE("Saledate.ntx")

Source:      RL_FILES.PRG

See also:    FILEDATE(), FILESIZE(), FILETIME()

See Also: FILEDATE() FILESIZE() FILETIME()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson