Thanks for the help but an error came up saying;
Quote: "ENDFUNCTION only accepts a single value or loacl variables at line 109"
this is my overall code
type monthstat
days as integer
name as string
endtype
Date$ = get date$
Print "Today's Date Is: ";Date$
Print "Today Is: ";CalendarDay(Date$)
currentdate=val(mid$(get date$(),4)+mid$(get date$(),5))
currentmonth=val(left$(get date$(),2))
currentyear=val("20"+right$(get date$(),2))
dim month(12) as monthstat
month(1).days=31 : month(0).name="January"
month(2).name="February"
month(3).days=31 : month(3).name="March"
month(4).days=30 : month(4).name="April"
month(5).days=31 : month(5).name="May"
month(6).days=30 : month(6).name="June"
month(7).days=31 : month(7).name="July"
month(8).days=31 : month(8).name="August"
month(9).days=30 : month(9).name="September"
month(10).days=31 : month(10).name="October"
month(11).days=30 : month(11).name="November"
month(12).days=31 : month(12).name="December"
for tmp=1 to 750
if tmp*4=currentyear then month(2).days=29 else month(2).days=28
next tmp
draw(month(currentmonth).days,0)
tmp$=str$(currentdate)+" "+month(currentmonth).name+" "+str$(currentyear)
text screen width()-text width(tmp$),0,tmp$
center text screen width()-(text width(tmp$)/2),text size(),str$(currentdate)+"/"+str$(currentmonth)+"/"+str$(currentyear)
wait key
function draw(daysinmonth,startday)
box 0,0,800,600
ink rgb(0,0,0),rgb(255,255,255)
center text screen width()/14*1,100-text size(),"Monday"
center text screen width()/14*3,100-text size(),"Tuesday"
center text screen width()/14*5,100-text size(),"Wednesday"
center text screen width()/14*7,100-text size(),"Thursday"
center text screen width()/14*9,100-text size(),"Friday"
center text screen width()/14*11,100-text size(),"Saturday"
center text screen width()/14*13,100-text size(),"Sunday"
for tmp=1 to 7
line screen width()/7*tmp,100,screen width()/7*tmp,screen height()
next tmp
for tmp=1 to 6
line 0,((screen height()/6)*tmp),screen width(),((screen height()/6)*tmp)
next tmp
for tmp=1 to daysinmonth
if tmp>0 and tmp<8 then text (screen width()/7)*(tmp-1+(startday)),100,str$(tmp)
if tmp>7 and tmp<15 then text (screen width()/7)*(tmp-8),200,str$(tmp)
if tmp>14 and tmp<22 then text (screen width()/7)*(tmp-15),300,str$(tmp)
if tmp>21 and tmp<29 then text (screen width()/7)*(tmp-22),400,str$(tmp)
if tmp>28 and tmp<35 then text (screen width()/7)*(tmp-29),500,str$(tmp)
next tmp
endfunction
Function CalendarDay(Date$)
For N = 1 To 2
Month$ = Month$ + Mid$(Date$,N)
Day$ = Day$ + Mid$(Date$,N+3)
Century$ = Century$ + Mid$(Date$,N+6)
Year$ = Year$ + Mid$(Date$,N+8)
Next N
DayVal = VAL(Day$)
MonthVal = VAL(Month$)
If MonthVal>2
Dec MonthVal,2
YearVal = VAL(Year$)
Else
Inc MonthVal,10
YearVal = VAL(Year$)-1
Endif
CenturyVal = VAL(Century$)
Dim Days$(6)
Days$(0)="Sunday"
Days$(1)="Monday"
Days$(2)="Tuesday"
Days$(3)="Wednesday"
Days$(4)="Thursday"
Days$(5)="Friday"
Days$(6)="Saturday"
X = Int((13*MonthVal-1)/5)
F = DayVal + X + YearVal + Int(YearVal/4) + Int(CenturyVal/4) - 2*CenturyVal
T = Int(f/7)
Today = f - 7*(f/7)
If Today < 0 Then Inc Today,7
EndFunction Days$(Today)
[url=http://www.cretinous.co.nr/]
[/url]