Re: Date Error in MS Works
On Mon, 21 Feb 2000 21:14:14 -0600, Joe Otto wrote:
>1900 wasn't a leap year, but an old, old spreadsheet that ran under MSDOS
>called Lotus 123 thought that it was a leap year. When Microsoft got into
>the spreadsheet market, they continued the error for the sake of backward
>compatibility. Nice, huh?
So are you being sarcastic (just another anti-Microsofty) or are you
commending MS on realizing IBM's error? I wonder how many MS spreadsheets
actually contain this user-entry error (perhaps from an imported DOS-based
Lotus 123 data file)? ... my guess, irrelevant ...
But just to play with the idea, I whipped up a command_line program for
testing...
-------------------------
include get.e
sequence cl, y
integer year, leapyear
cl = command_line()
if length( cl ) < 3 then
puts( 1, "Usage: ly <year>\nReturns: Yes if it's a leap year..." )
abort( 1 )
else
y = value( cl[3] )
if y[1] = GET_FAIL or y[1] = GET_EOF then
puts( 1, "Usage: ly <year>\nReturns: Yes if it's a leap year..." )
abort( 2 )
else
year = y[2]
end if
end if
leapyear = ( ( remainder( year, 4 ) = 0 ) and
( remainder( year, 100 ) != 0 ) )
or ( remainder( year, 400 ) = 0 )
if leapyear then
puts( 1, "Yes, it's a leap year!" )
else
puts( 1, "Nope, it's not a leap year." )
end if
-------------------------
-- Brian
|
Not Categorized, Please Help
|
|