6 |
The LA Fox Developer Newsletter
March 1996
FoxPro 2000
(Con’t from page 5)
Unrestricted Use:
cTODCChar’)
DAY({Date})
MONTH({Date})
YEAR({Date}) Always returns (CCYY] Format.
CDOW()
SYS(1), SYS(10) Julien Day. Accepts Date to 12/31/9999.
TIME()
PC Systems Time
DATE()
If
"Year2000 .EXE"
is
used.
Restricted Use after 1999:
DATE()
If “Year2000.EXE” Is not used.
Set Century ON/OFF
DTOC()
Format determined by [Set Century].
?
{ }
Format determined by (Set Century].
@
GET <Expr> PICT Picture Clause not respected by [Set
Century].
? cTOD(DTOC(Date0)) [VY] depends on [Set Century]
Examples:
command
Year
Note
? YEAR(CTOD(DTOC((01/01/
})))
1900
Should be Error
Set Cent Off
? YEAR(cTOD(DTOC({0l/01Ill01})))
1901
Assumes 20th Cent.
Set Cent On
? YEAR(CTOD(DTOC({0l/0lI1
101})))
1101
2.3 Date Entries:
Unless you stay with the 8 digit Date Format you end up
redesigning Forms.
CurrentTransaction Dates:
They are a bit tricky since the 8 digit [MM/DD/YY] Format uses
the FP Default Century.
Historical Dates
: These would be outside the Default Century
Range and still must be entered in the 10 digit [MM/DD/CCYY]
Format
to record properly, so that {01/01/1 045) records as the
year
1045.
2.4
Date Validation:
Needs to be expanded within the Function, as the results of
Date Entries can be all over the Centuries. For instance, FP
translates a blank [YY] to [00], thus this 4 digit Non-Date of {3/
1/) returns 03/01/1900, but shouldn’t this return an error? Not
acceptable!
2.5
Date Storage:
Dates are stored as a complete 10 digit Date with Century
Indicator, but are displayed in 8 or 10 digit Format, according to
Century OFF or ON. This is OK by me since I can get used to
interpreting {01/01/00}as 2000, as long as everything else works
OK.
2.6
Size of Date Fields:
In DBF’s, the standard Date Field Size of [0-8] does not change
with Set Century, but the actual Display follows the Set Century
Rule and becomes [0-10] with Set Cent ON.
3.0
WHAT NEEDS TO BE DONE TO APP’S?
At it’s simplest, one can use GOMONTH(+1200) to add 100
Years to a Date to jump into the 21st Century, but all other
quirks with the Date Functions remain invalidated.
My goal was to update my App’s with minimum effort, not
spend days or weeks fighting pixel congestion. With a few
exceptions, I want to stay with my existing 8 digit Data Entry
Format. This requires establishing my own Default Century
Indicator and bypassing Set Century ON/OFF as much as
possible and let the “unrestricted” Function to most of the work.
4.0 MCDATEO Features:
Syntax
:
=
MCDATE( Input, ‘dMemVar’)
Use
: Attach to ©Get Datebox with VALID
MCDATEO, or use in embedded code to
return [dMemVar]
DefaultCentury :1980 to 2079
Twin Inputs
: Type
[CI
as’ /
/ ‘or Type [DI as
{
/ /
}.
8-or 10-digit size
Twin Returns
:1. Return [.T.] or [0] for Datebox Validation
and
2.
Places the validated Date into
[dMemvar] as specified using the [MM/DO!
CCYY] Format.
The Good News:
I have done it, and am currently Beta Testing my new Function
in two APP’s. It took me longer to write this article than
adapting my APP’s and you can do it too. Contact Barry Lee for
free copies of YEAR2000.ZIP and MCDATE.PRG.
(Ed. Note: These programs are available by request to anyone
on the LA Fox-Cast. For anyone that isn’t on an online service,
please see me at the meetings to make arrangements.)
Out and About
(Con’t from page 4)
dDay Fair
We just recently learned that dDay Fair, spon-
sored by VWdBUG, will not be going on this year. But read on:
Board meeting notes LA Fox will start looking into “official”
non-profit status. We are also investigating co-sponsoring and
partnering a dDay-type Fair since the Valley Group seems to be
losing interest in carrying on this time-honored tradition. If it
happens, it’ll probably be in the September/October time frame
and moved further south. Let us know if you think this idea is
worthwhile. You’re not volunteering for anything <g>, you’re just
letting us know how you feel. We also have two new Board
members
-
George Porter and Michael Meer.
Memberships for those people whose dues expired in ‘95 are
due this month. Please look at your last newsletter label and if
the expiration date reads xx/xx/95, that means you. We’ve
been trimming back our mailing list each month, beginning last
January. There are currently about 30 members whose dues
expired in ‘95 and if they all paid, it would infuse our treasury
with about $1300. This amount roughly offsets the “running
(Con't, page 8)
Page 6
|
6 |