timur77
Junior Member
Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on Apr 1, 2020 14:19:24 GMT -5
program reverse timer until the specified date
|
|
timur77
Junior Member
Someday I will tell my grandsons that I am older than the Internet. And it will blow their brain.
Posts: 79
|
Post by timur77 on Apr 1, 2020 14:20:54 GMT -5
here is the code
nomainwin d=DisplayWidth sh=DisplayHeight WindowWidth = 260 WindowHeight = 174 UpperLeftX=d-260+2'd/2-WindowWidth/2 UpperLeftY=sh-38-174'sh/2-WindowHeight/2
denn=1 mess=1 godd=2022 den$="5" mesac$="8" god$="2021"
denn2=0 mess2=0 godd2=0 den2$="0" mesac2$="0" god2$="0"
ch11=11 ch22=11 mm11=11 mm22=11 ss11=11
godz$="лет" mesz$="месяцев" denz$="дней"
[start] graphicbox #win.gbox, 0, 0, 260, 80 graphicbox #win.gbox1, 0, 80, 255, 65 textbox #win.gbox.tb1, 27,5,25,30 textbox #win.gbox.tb2, 80,5,25,30 textbox #win.gbox.tb3, 127,5,50,30 button #win.gbox.b1, "Обновить", [update], UL, 180, 5, 70, 25 open "Timer" for window_nf as #win #win, "trapclose [exit]" #win.gbox, "font Arial 8 33" #win.gbox.tb1, "!font calibri 13" #win.gbox.tb2, "!font calibri 13" #win.gbox.tb3, "!font calibri 13" #win.gbox, "fill 0 0 95" #win.gbox, "color 255 255 0" #win.gbox, "backcolor 0 0 96" #win.gbox, "place 5 28" #win.gbox, "\Д:" #win.gbox, "place 55 28" #win.gbox, "\М:" #win.gbox, "place 107 28" #win.gbox, "\Г:" #win.gbox.tb1, den$ #win.gbox.tb2, mesac$ #win.gbox.tb3, god$
#win.gbox1, "font calibri 40" #win.gbox1, "fill 0 0 0" #win.gbox1, "color 0 255 0" #win.gbox1, "backcolor 0 0 0" #win.gbox1, "place 70 50" #win.gbox1, "\:" #win.gbox1, "place 160 50" #win.gbox1, "\:"
timer 1000, [vrem]
[update] #win.gbox.tb1, "!contents? den$" #win.gbox.tb2, "!contents? mesac$" #win.gbox.tb3, "!contents? god$" d1=date$("days") d2=date$(mesac$+"/"+den$+"/"+god$) dd=d2-d1 dd3$=date$(str$(dd)) denn=val(mid$(dd3$,4,2))-1 mess=val(mid$(dd3$,1,2))-1 godd=val(mid$(dd3$,7,4))-1901
goddb=godd mod 10 messb=mess mod 10 dennb=denn mod 10
if goddb=1 then godz$="год" if 1<goddb and goddb<5 then godz$="года" if 4<goddb or goddb=0 then godz$="лет" if messb=1 then mesz$="месяц" if 1<messb and messb<5 then mesz$="месяца" if 4<messb or messb=0 then mesz$="месяцев" if dennb=1 then denz$="день" if 1<dennb and dennb<5 then denz$="дня" if 4<dennb or dennb=0 then denz$="дней"
#win.gbox, "place 10 62" #win.gbox, "\";godd;"-";godz$;", ";mess;"-";mesz$;", ";denn;"-";denz$;" " wait
[vrem] vr=86400-time$("seconds") ch1=int(vr/36000) ch2=int((vr mod 36000)/3600) mm1=int((vr mod 3600)/600) mm2=(int((vr mod 3600)/60) mod 10) ss1=int((vr mod 60)/10) ss2=(vr mod 60) mod 10
For i=1 to 50 if ch1<>ch11 Then #win.gbox1, "place 5 ";i: #win.gbox1, "\";ch1 if ch2<>ch22 Then #win.gbox1, "place 35 ";i: #win.gbox1, "\";ch2 if mm1<>mm11 Then #win.gbox1, "place 95 ";i: #win.gbox1, "\";mm1 if mm2<>mm22 Then #win.gbox1, "place 125 ";i: #win.gbox1, "\";mm2 if ss1<>ss11 Then #win.gbox1, "place 185 ";i: #win.gbox1, "\";ss1 #win.gbox1, "place 215 ";i: #win.gbox1, "\";ss2 ppp=time$("ms") [pause] if ppp+7>time$("ms") then goto [pause] next i ch11=ch1 ch22=ch2 mm11=mm1 mm22=mm2 ss11=ss1
if vr>86398 Then goto [update] wait
[exit] close #win end
|
|
|
Post by tsh73 on Apr 1, 2020 14:51:09 GMT -5
Odometer effect is really nice.
|
|
|
Post by David Drake on Apr 16, 2020 14:25:39 GMT -5
That is pretty slick. I like it.
|
|
Larry
New Member
Posts: 40
|
Post by Larry on Apr 27, 2020 16:40:11 GMT -5
Totally rad
|
|