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> olderfile() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    OLDERFILE()

Purpose:     Determine the older of two disk files.

Syntax:      OLDERFILE( file1, file2 [, timedigits ] )

Arguments:   file1       - Character string or variable indicating the
                           name of the file to compare with <file2> to
                           determine which is older.

             file2       - Character string or variable indicating the
                           name of the file to compare with <file1> to
                           determine which is older.

             timedigits  - Numeric value indicating the number of
                           significant digits in the file time character
                           string to use.  If not specified or an invalid
                           parameter is passed the default of 5
                           significant digits is used which yields time
                           comparison to the minutes ("10:01")

Returns:     A numeric value indicating one of the following:

                          0 = file dates and times are equal
                          1 = file 1 is older than file 2
                          2 = file 2 is older than file 1
                         -1 = file 1 does not exist
                         -2 = file 2 does not exist
                         -3 = Other (syntax error)

Description: OLDERFILE() is a file function useful for easily comparing
             two files to determine which file is older.  Alternately, it
             can be used to quickly test if two files share the same file
             date and time stamp.

Notes:       Time precision is only accurate to seconds, not hundredths of
             seconds.  It is VERY unlikely that two files will have the
             exact same creation time to the second much less the
             hundredths of a second, hence the default time string
             precision is to 5 digits.  To get accuracy to the second make
             the precision 8 (10:00:00), to hundredths of seconds make the
             precision 11 (10:00:00.00)

             OLDERFILE() uses the RLIB functions FILEDATE() and FILETIME()
             to extract file dates/times from the DOS directory
             information.  File date and time stamps are subject to the
             limitations posed by DOS's maintenance schedule.  In other
             words, if a file is already open, the date and/or time stamp
             from the directory information may not be updated until the
             file is closed.

Example:     *-- check if database file was updated since last indexed
             IF OlderFile("myfile.dbf", "myfile.ntx") = 1
                *-- reindex here
                *-- or do something else
             ENDIF

Source:      RL_OLDER.PRG

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

See Also: FILEDATE() FILES() FILETIME()

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