home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 Secrets / Secrets2.iso / Utility / Calendar / Command / SETUP.EXE / YEARFISCAL.CC1 < prev   
Encoding:
INI File  |  1997-06-12  |  3.8 KB  |  144 lines

  1. [OPTIONS]
  2. ; YearFiscal.cc1 written by Kent Briggs
  3. ; n00 = line color
  4. ; n01 = text color
  5. ; n02 = day
  6. ; n03 = month
  7. ; n04 = year
  8. ; n05 = x
  9. ; n06 = y
  10. ; n07 = loop 1 to 12 months
  11. ; n08 = x2
  12. ; n09 = y2
  13. ; n10 = current month
  14. ; n11 = julian day
  15. ; n12 = loop 1 to 7 days
  16. ; n13 = week starts
  17. ; n14 = week number
  18. ; n15 = weeks in month
  19. ; n16 = loop 1 to weeks
  20. ; n17 = shading color
  21. ; t00 = title
  22. ; t01 = footnote
  23. ; t02 = week string
  24. ; t03 = typeface
  25. ; t04 = subtitle
  26. ; t05 = month/dow name
  27. ; t06 = week test 1
  28. ; t07 = week test 2
  29. Orientation(Portrait)
  30. Option(t00,Text [t],"Title","Fiscal Year")
  31. Option(t04,Text [t],"Subtitle","Company Name")
  32. Option(t01,Text [t],"Footnote","Printed by Calendar Commander")
  33. Option(t02,Text [t],"Weeks in months 1-12","445445445445")
  34. Option(n00,Color [n],"Line color",0)
  35. Option(n17,Color [n],"Shading color",$C0FFFF)
  36. Option(n01,Color [n],"Text color",0)
  37. Option(t03,Typeface [t],"Typeface","Times New Roman")
  38. [COMMANDS]
  39. ; draw title, subtitle, footnote
  40. Font(t03,4,n01,0,0,0,0)
  41. Text(50,2,1,t00)
  42. Font(t03,3,n01,0,1,0,0)
  43. Text(50,7,1,t04)
  44. Font(t03,1.5,n01,0,0,0,0)
  45. Text(50,98,7,t01)
  46. ; get starting date
  47. DateNum(n02,Day)
  48. DateNum(n03,Month)
  49. DateNum(n04,Year)
  50. WeekDay(n13,n04,n03,n02)
  51. ; calc julian day
  52. DateToJulian(n11,n04,n03,n02)
  53. NumVar(n10,set equal to,n03)
  54. ; find first full month
  55. Block(If,n02,>,15)
  56.   NumVar(n10,increment by,1)
  57. EndBlock
  58. ; initialize x,y values
  59. NumVar(n05,set equal to,5)
  60. NumVar(n06,set equal to,12)
  61. NumVar(n07,set equal to,1)
  62. NumVar(n14,set equal to,1)
  63. TextVar(t06,set equal to,"")
  64. TextVar(t07,set equal to,"")
  65. Pen(n00,2,0)
  66. ; loop for 12 months
  67. Block(While,n07,<=,12)
  68.   NumVar(n08,set equal to,n05)
  69.   NumVar(n08,increment by,28)
  70.   NumVar(n09,set equal to,n06)
  71.   NumVar(n09,increment by,3)
  72.   Brush(n17,0)
  73.   Rectangle(n05,n06,n08,n09,1)
  74.   Brush($FFFFFF,1)
  75.   NumVar(n06,increment by,3)
  76.   NumVar(n09,increment by,15)
  77.   NumVar(n08,decrement by,24.5)
  78.   Brush(n17,0)
  79.   Rectangle(n05,n06,n08,n09,0)
  80.   Brush($FFFFFF,1)
  81.   NumVar(n08,increment by,24.5)
  82.   Grid(n05,n06,n08,n09,8,6,1)
  83.   NumVar(n06,decrement by,3)
  84.   ; draw month name
  85.   DateText(t05,Month,Full,Capitalized,n10)
  86.   NumVar(n08,decrement by,14)
  87.   NumVar(n09,decrement by,16.5)
  88.   Font(t03,2,n01,0,0,0,0)
  89.   Text(n08,n09,4,t05)
  90.   ; draw week days
  91.   NumVar(n08,decrement by,12.25)
  92.   NumVar(n09,increment by,2.75)
  93.   Font(t03,1.5,n01,0,0,0,0)
  94.   Text(n08,n09,4,"Wk")
  95.   NumVar(n12,set equal to,1)
  96.   Block(While,n12,<=,7)
  97.     NumVar(n08,increment by,3.5)
  98.     DateText(t05,Day of week,1-letter,Capitalized,n13)
  99.     Text(n08,n09,4,t05)
  100.     NumVar(n12,increment by,1)
  101.     NumVar(n13,increment by,1)
  102.   EndBlock
  103.   NumVar(n13,decrement by,7)
  104.   NumVar(n08,decrement by,24.5)
  105.   NumVar(n09,increment by,2.5)
  106.   ; get weeks in current month
  107.   TextVar(t06,append with,"5")
  108.   Block(If,t02,>=,t06)
  109.     NumVar(n15,set equal to,5)
  110.     TextVar(t07,append with,"5")
  111.   EndBlock
  112.   Block(If,t02,<,t06)
  113.     NumVar(n15,set equal to,4)
  114.     TextVar(t07,append with,"4")
  115.   EndBlock
  116.   TextVar(t06,set equal to,t07)
  117.   NumVar(n16,set equal to,1)
  118.   Block(While,n16,<=,n15)
  119.     Text(n08,n09,4,n14)
  120.     NumVar(n08,increment by,3.5)
  121.     NumVar(n12,set equal to,1)
  122.     Block(While,n12,<=,7)
  123.       ; convert julian back to day
  124.       JulianToDate(n02,Day,n11)
  125.       Text(n08,n09,4,n02)
  126.       NumVar(n12,increment by,1)
  127.       NumVar(n11,increment by,1)
  128.       NumVar(n08,increment by,3.5)
  129.     EndBlock
  130.     NumVar(n08,decrement by,28)
  131.     NumVar(n09,increment by,2.5)
  132.     NumVar(n14,increment by,1)
  133.     NumVar(n16,increment by,1)
  134.   EndBlock
  135.   ; advance to next month
  136.   NumVar(n07,increment by,1)
  137.   NumVar(n10,increment by,1)
  138.   NumVar(n05,increment by,31)
  139.   Block(If,n05,>,90)
  140.     NumVar(n05,set equal to,5)
  141.     NumVar(n06,increment by,21.5)
  142.   EndBlock
  143. EndBlock
  144.