_TITLE "Steve's Calendar Creator"
CONST PhotoFolder
= ".\National Geographic\" 'IF _FILEEXISTS(PhotoFolder + "PhotoList.txt") = 0 THEN
PhotoList$ = "*.jpg *.png " 'add more extensions if you want to add GIF/PNG files and such
SHELL "DIR " + PhotoList$
+ "/b /s /a-d >PhotoList.txt"
PhotoCount = PhotoCount + 1
SEEK #1, 1 'back to the beginning
FileList
(i
) = FileList
(i
) + CHR$(0)
Notes(0) = "1) Steve 555-5555"
Notes(1) = "2) Lori 555-5555"
DrawCalander
H = W 'height
L = 5 'line thickness
' Kolor = _RGB32(127, 107, 0) 'color of lines
Kolor
= _RGBA32(0, 0, 0, 128) 'color of lines
PicNum
= INT(RND * PhotoCount
) + 1
x2 = x1 + W
x1 = 0
y2 = y1 + H
y1 = 0
_PUTIMAGE (0, 0)-(W
, H
), Pic
, 0, (x1
, y1
)-(x2
, y2
)
FOR i
= 0 TO L:
LINE (0 + i
, 0 + i
)-(W
- i
, H
- i
), Kolor
, B:
NEXT 'Outer frame first FOR i
= 1 TO 6:
LINE (i
* W \
7 - L \
2, 0)-(i
* W \
7 + L \
2, W
), Kolor
, BF:
NEXT 'inner lines next FOR i
= 1 TO 6:
LINE (0, i
* W \
7 - L \
2)-(W
, i
* W \
7 + L \
2), Kolor
, BF:
NEXT LINE (L
+ 1, L
+ 1)-(W
- L
- 1, W \
7 - L \
2), Blue
, BF
'Top Box for month
FirstDay = GetDay(k, 1, Year)
count = 0
IF (y
- 1) * 7 + x
>= FirstDay
THEN count = count + 1
IF count
<= DaysInMonth
(k
) THEN
T$
= Month$
(k
) + STR$(Year
)
FUNCTION GetDay
(m
, d
, y
) 'use 4 digit year 'From Zeller's congruence: https://en.wikipedia.org/wiki/Zeller%27s_congruence
mm = m: dd = d: yyyy = y
IF mm
< 3 THEN mm
= mm
+ 12: yyyy
= yyyy
- 1 zerocentury = yyyy \ 100
result
= (dd
+ INT(13 * (mm
+ 1) / 5) + century
+ INT(century
/ 4) + INT(zerocentury
/ 4) + 5 * zerocentury
) MOD 7 GetDay = 7
GetDay = result
'Function changed to return a numeric value instead of a string for this program
' SELECT CASE result
' CASE 7: GetDay$ = "Saturday"
' CASE 1: GetDay$ = "Sunday"
' CASE 2: GetDay$ = "Monday"
' CASE 3: GetDay$ = "Tuesday"
' CASE 4: GetDay$ = "Wednesday"
' CASE 5: GetDay$ = "Thursday"
' CASE 6: GetDay$ = "Friday"
' END SELECT
CASE 1, 3, 5, 7, 8, 10, 12 DaysInMonth = 31
DaysInMonth = 28
IF Year
MOD 4 = 0 THEN DaysInMonth
= 29 'leap year until 2100 -- and I'll be deaded by then, so who cares. :P DaysInMonth = 30
CASE 1: Month$
= "January" CASE 2: Month$
= "February" CASE 8: Month$
= "August" CASE 9: Month$
= "September" CASE 10: Month$
= "October" CASE 11: Month$
= "November" CASE 12: Month$
= "December"