home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Long_date
-
- PARAMETERS _array, _oldest
-
- PRIVATE _the_ret_val, _the_element
-
- IF PCOUNT() = 0
- RETURN(-1)
- ELSEIF PCOUNT() = 1
- _oldest = .T.
- ELSEIF TYPE("_array") != "A"
- RETURN(-1)
- ENDIF
-
- * This function returns the oldest, or the youngest date element
- * in the given array
-
- _the_ret_val = 0
- IF _oldest
- _the_element = CTOD(" / / ")
- ELSE
- _the_element = CTOD("12/31/99")
- ENDIF
-
- FOR _downtoit = 1 TO LEN(_array)
- d_type = _array[_downtoit]
- IF TYPE("d_type") = "D"
- IF _oldest
- IF d_type > _the_element
- _the_element = d_type
- _the_ret_val = _downtoit
- ENDIF
- ELSE
- IF d_type <= _the_element
- _the_element = d_type
- _the_ret_val = _downtoit
- ENDIF
- ENDIF
- ENDIF
- NEXT
- RETURN(_the_ret_val)
-
- * End of File