SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : Y2K (Year 2000) Stocks: An Investment Discussion

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: David Eddy who wrote (9404)2/9/1998 1:34:00 PM
From: Hoatzin   of 13949
 
David,

I had similar thoughts when I read that article.

Here's a chunk of code I came across a while back.
It defines the format of a date field on a screen, and has some rules about what is and is not a valid date.
Without looking at the rest of the program, let's assume that there are no other y2k problems.
At least the program will allow "00" as a valid year, so far so good. But you will NOT be able to input "02/29/00",
since "00" is not in the list of valid leap years.
There is NO mistaking 2000 for 1900 (although we don't know what
the effects of this two-digit year might be later on in the program), this just bad design
(are common date routines that hard to use?) and sloppy code.

01 WS-MAP-DATE-FORMAT.
05 WS-MAP-DATE-MM PIC XX VALUE SPACES.
88 VALID-MONTH VALUES '01' THRU '12'.
88 28-DAY-MONTH VALUE '02'.
88 30-DAY-MONTH VALUES '04' '06' '09' '11'.
88 31-DAY-MONTH VALUES '01' '03' '05' '07' '08' '10' '12'.
05 WS-MAP-DATE-DD PIC XX VALUE SPACES.
88 VALID-DAY VALUES '01' THRU '31'.
05 WS-MAP-DATE-YY PIC XX VALUE SPACES.
88 VALID-YEAR VALUES '00' THRU '99'.
88 LEAP-YEAR VALUES '04' '08' '12' '16' '20' '24' '28'
'32' '36' '40' '44' '48' '52' '56' '60' '64' '68' '72'
'76' '80' '84' '88' '92' '96'.

Got any tools to fix this one automatically?

Kevin
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext