Created
October 24, 2014 04:00
-
-
Save ttdoda/57a4154305d82fd61c51 to your computer and use it in GitHub Desktop.
カレンダー表示Tera Termマクロ1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getdate y "%Y" | |
str2int year y | |
getdate m "%m" | |
str2int mon m | |
getdate d "%d" | |
str2int day d | |
getdate w "%w" | |
str2int wday w | |
offset = (wday + 8 - (day % 7)) % 7 | |
strcopy "303232332323" mon 1 ex_str | |
str2int ex_v ex_str | |
mdays = 28 + ex_v | |
if mon == 2 && (year % 400 == 0 || year % 100 != 0 && year % 4 == 0) mdays = mdays + 1 | |
dispstr #$1b"[H"#$1b"[2J" | |
sprintf2 fmt "%%%ds" offset*3 | |
sprintf2 cal fmt "" | |
dispstr cal | |
for i 1 mdays | |
sprintf2 cal "%2d" i | |
dispstr cal | |
if (offset + i) % 7 == 0 then | |
dispstr #$0a "" #$0d | |
else | |
dispstr " " | |
endif | |
next | |
if offset % 7 != 0 then | |
dispstr #$0a" "#$0d | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment