/* * Concordance Programming Language Calendar Display Program * * Copyright (c) 1992 Dataflight Software, Inc. * ALL RIGHTS RESERVED. * 3200 Airport Avenue, Suite 19 * Santa Monica, CA 90230 * * Unauthorized distribution, adaptation or use may be * subject to civil and criminal penalties. * * You may incorporate this program into your own programs * ONLY if you incorporate the following copyright notice: * * Copyright (c) 1992 YOUR NAME. ALL RIGHTS RESERVED. * Portions copyright (c) 1992 Dataflight Software, Inc. */ main() { int i = today(); cls(); calendar(01,03,ctod(str(month(i)-1)+"/1/"+str(year(i)))); calendar(01,28,today()); calendar(01,53,ctod(str(month(i)+1)+"/1/"+str(year(i)))); calendar(13,03,ctod(str(month(i)+2)+"/1/"+str(year(i)))); calendar(13,28,ctod(str(month(i)+3)+"/1/"+str(year(i)))); calendar(13,53,ctod(str(month(i)+4)+"/1/"+str(year(i)))); getkey(); } /**************************************************************** * Summary: calendar * * Synopsis: Displays a calendar for the specified month at * * the specified row and column coordinates. * ****************************************************************/ calendar(int row, col, startDate) { int i; char string[3]; text months[13]; int startMonth; months[1] = "January"; months[2] = "February"; months[3] = "March"; months[4] = "April"; months[5] = "May"; months[6] = "June"; months[7] = "July"; months[8] = "August"; months[9] = "September"; months[10] = "October"; months[11] = "November"; months[12] = "December"; startMonth = month(startDate); i = ctod(str(startMonth)+"/1/"+str(year(startDate))); puts(row,col,pad(months[startMonth]+str(year(i),5),'C',22),MenuColor_); row = row + 1; scroll(row,col,row+8,col+20,0,0,MenuColor_); box(row,col,row+9,col+21,'3D',MenuColor_); puts(row+2,col+1,rep('_',20),MenuColor_); puts(row+1,col+1,"Su Mo Tu We Th Fr Sa",MenuColor_); row = row + 3; while(month(i) == startMonth) { switch(string = weekday(i)) { case "Su": puts(row,col+1,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "Mo": puts(row,col+4,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "Tu": puts(row,col+7,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "We": puts(row,col+10,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "Th": puts(row,col+13,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "Fr": puts(row,col+16,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); break; case "Sa": puts(row,col+19,str(day(i),2),(i <> today()) ? MenuColor_ : MenuHighlight_); row = row + 1; break; } i = i + 1; } } /* calendar() */