home *** CD-ROM | disk | FTP | other *** search
- * Function ..... DAYWORD()
- * Author ....... Steve Straley
- * Date ......... August 21, 1985
- * Syntax ....... DAYWORD(date_exp)
- * Parameters ... Date_value
- * Returns ...... <string variable>
- * Notes ........ This function will return the a word string variable
- * cooresponding to the date that is passed. For example,
- * on days like 1,21,31, the function will return "1st", or
- * the "21st", etc.
-
- FUNCTION Dayword
-
- PARAMETERS in_date
-
- in_day = str(day(in_date),2)
- in_val = val(substr(in_day,2,2))
- IF in_val > 10 .OR. < 20
- in_day = in_day + "th"
- ELSE
- in_val = val(substr(in_day,2,1))
- in_day = in_day + SUBSTR("thstndrdthththththth", (in_val * 2)+1, 2)
- ENDIF
-
- RETURN(in_day)