Skip to content

Instantly share code, notes, and snippets.

@ttdoda
Created October 24, 2014 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttdoda/6b48923989a642f6cbf3 to your computer and use it in GitHub Desktop.
Save ttdoda/6b48923989a642f6cbf3 to your computer and use it in GitHub Desktop.
カレンダー表示Tera Termマクロ2
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
sprintf2 fmt "%%%ds" offset*3
sprintf2 cal fmt ""
for i 1 mdays
sprintf2 cal "%s%2d" cal i
if (offset + i) % 7 == 0 then
strconcat cal #$0d#$0a
else
strconcat cal " "
endif
next
sprintf2 title "%d/%d" year mon
messagebox cal title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment