7 |
The LA Fox Developer Newsletter
|
December 1997
|
|
will giveyou: Thu.
|
that you specify.
where: dDate is the “Date” that you want converted
(the default is date0).
Mask is the character mask for converting the date
(the default is the dtoc() function).
Mask characters that wU! ba converted are;
Mask Returns
"YYYY" 4 character year
“MMMM” month name
“MMM” first 3 characters of month name
month number
day of the week
“DDD” first 3 characters of day of week
‘DD” day number
will give you: Thursday, September 12, 1996
will give you: Sep.12/96
|
FUNCTION cdate LPARAMETERS cMask, dDate if parameters()
=
0
return dtoc(dateO)
endif
if parameters()
=
I
if type(’cMask’)
=
dDate
=
cMask
cMask
=
return dtoc(dDate) else
dDate
=
date()
endif
endif
if empty(dDate)
return
endif
if type(’cMask’)
<>
‘C’
clear typeahead
=messagebox(”Invalid parameter (#1 cMask) passed to CDATE function!”,16,”Programmer Error”)
return
endif
if type(’dDate’)
<>
‘D’
clear typeahead
=messagebox(”Invalid parameter (#2 dDate) passed to CDATE function!",16,"Programmer Error”)
return
endif
cMask
=
upper(cMask)
cMask
=
strtran(cMask,”YYYY”,ltrim(str(year(dDate))))
cMask
=
(strtran(cMask,"YY",padl(ltrim(right(str(year(dDate)),2)),2,'0'))
cMask
=
strtran(cMask,”MMMM”,cmonth(dDate))
cMask
=
strtran(cMask,”MMM”,left(cmonth(dDate),3))
cMask
=
strtran(cMask,”MM”,padl(ltrim(str(month(dDate),2)),2,’O’))
cMask
=
strtran(cMask,”DDDD”,cdow(dDate))
cMask
=
strtran(cMask,”DDD”,left(cdow(dDate),3))
cMask
=
strtran(cMask,”DD’,padl(ltrim(str(day(doate),2)),2,’O’))
RETURN cMask
If you are a member of The Universal Thread, you might want to check out a new online/offline reader that was released on 10/ 07. It offers many features which will
enhance your productivity, allowing you to process unread messages offline.
This is particularily of benefit
if
you access the ‘net on an hourly basis. See the Universal Thread Navigator link from the Universal Thread main page in order to get all the
details about it. The Universal Thread can be accessed at universalthread.com.
|
Page 7
|
7 |