Page 1 of 1

Script for calculating the difference between two dates, which doesn't work 100%...

Posted: Apr 1st, ’21, 20:37
by Oblomov
Hello,

I'm trying to get 'HowLongYearsMonthsDays.ahk' working on FK, from:
http://www.computoredge.com/AutoHotkey/ ... ml#HowLong

Direct link to the script:
http://www.computoredge.com/AutoHotkey/ ... ays1.2.ahk

And it works just fine, but upon closing the window, it starts messing with FK, as though the script is still running somehow...

Not really sure if it's missing a 'return' somewhere, or the like...

Kind regards
...

Re: Script for calculating the difference between two dates, which doesn't work 100%...

Posted: Apr 4th, ’21, 09:19
by Marko
If you are using Type: Command you need to

Add this before creating a Gui (Gui, Add):

Code: Select all

Gui, SpanCalc:Destroy
and remove the following last couple of lines, as they have impact on all scripts:

Code: Select all

; Enable mousewheel in AutoHotkey GUIs

#If MouseIsOver("ahk_class AutoHotkeyGUI")
   WheelUp::Send {Up}
   WheelDown::Send {Down}
#If

MouseIsOver(WinTitle)
{
   MouseGetPos,,, Win
   Return WinExist(WinTitle . " ahk_id " . Win)
}

^!z::
  GuiControl, SpanCalc: , SysDateTimePick321, 20000101
Return

Re: Script for calculating the difference between two dates, which doesn't work 100%...

Posted: Apr 4th, ’21, 17:47
by Oblomov
Thanks for the feedback!

Would 'Gui, SpanCalc:Destroy' be placed here or between every Gui line perhaps?

Code: Select all

...
Gui, SpanCalc:Destroy

HowLongAutoExec:



Gui, SpanCalc:Add, Text, , Enter Date One:
Gui, SpanCalc:Add, DateTime, vDate1, LongDate
...
Kind regards
...

Re: Script for calculating the difference between two dates, which doesn't work 100%...

Posted: Apr 4th, ’21, 20:02
by Marko
Just before first Add:

Code: Select all

...
HowLongAutoExec:

Gui, SpanCalc:Destroy
Gui, SpanCalc:Add, Text, , Enter Date One:
Gui, SpanCalc:Add, DateTime, vDate1, LongDate
...

Re: Script for calculating the difference between two dates, which doesn't work 100%...

Posted: Apr 5th, ’21, 15:43
by Oblomov
Marko wrote: Apr 4th, ’21, 20:02 Just before first Add:

Code: Select all

...
HowLongAutoExec:

Gui, SpanCalc:Destroy
Gui, SpanCalc:Add, Text, , Enter Date One:
Gui, SpanCalc:Add, DateTime, vDate1, LongDate
...
Gotcha, thanks! :D