home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
portfoli
/
pbas45.lzh
/
days.bas
< prev
next >
Wrap
BASIC Source File
|
1991-08-21
|
928b
|
37 lines
rem bj gleason
rem fixed date calculations for january
rem changed x,y corrdinates for 2.1
cls
dim m(12)
' days in each month
m(1)=31:m(2)=28:m(3)=31:m(4)=30
m(5)=31:m(6)=30:m(7)=31:m(8)=31
m(9)=30:m(10)=31:m(11)=30:m(12)=31
print "Enter First Date"
r=2:c=1
gosub 1000 ' get the first date
d1 = d
locate 1,21:print "Enter Second Date"
r=2:c=21
gosub 1000 ' get the second date
d2 = d
diff = abs(d2-d1) ' number of days
box 5,1,7,40,1
locate 6,10:print "Number of days : " diff
end
1000 ' read in date, convert to days
' in D
locate r,c:input "Month";month
locate r+1,c:input "Day ";day
locate r+2,c:input "Year ";year
if (year%4)=0 then m(2)=29 else m(2)=28
d = 0
' get number of days this year
for x = 1 to month-1
d = d + m(x)
next x
if month = 1 then d = 0
d = d + int(year*365.25) + day
return
ə