Skip to content

Instantly share code, notes, and snippets.

@ttdoda
Created October 24, 2014 04:00
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/57a4154305d82fd61c51 to your computer and use it in GitHub Desktop.
Save ttdoda/57a4154305d82fd61c51 to your computer and use it in GitHub Desktop.
カレンダー表示Tera Termマクロ1
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