home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Author: DAVID -(FLASH)- GORDON CompuServ ID - 75130,3664
-
- Originally: Program COPYRIGHT 1991, FlashPoint
-
- Now and Forever: Released into the Public Domain
-
- Note: FlashPoint is a Registered Trademark
-
- Purpose: DateSwap() was designed for date validation. It is
- mainly used with reports covering a date range. It
- will ensure that the users two date fields are kept
- in the proper sequence and that they are real dates.
- */
-
- * Usage In Your Application
- ******************************************************************************
-
- LOCAL dFirst := dSecond := CTOD(" / / ")
-
- DateSwap(@dFirst, @dSecond)
-
- ******************************************************************************
-
- FUNCTION DateSwap(dDate1, dDate2)
- LOCAL dTemp
- IIF( dDate1 == ctod(" / / "), dDate1 := date(), )
- IIF( dDate2 == ctod(" / / "), dDate2 := date(), )
- IF dDate1 > dDate2
- dTemp := dDate1
- dDate1 := dDate2
- dDate2 := dTemp
- ENDIF
- return .t.
-