Baster Posted October 31, 2011 Author Share Posted October 31, 2011 It's not, i've checked the txt file almost 20 times! The last line is 28/10/2011! Thank for your help, now I try on myself and I'll let you know, ok? Link to comment Share on other sites More sharing options...
czardas Posted October 31, 2011 Share Posted October 31, 2011 You may just be missing FileOpen. Read the remarks about FileReadLine in the help file. If you still are having problems post the changes you have made so far. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Baster Posted October 31, 2011 Author Share Posted October 31, 2011 Ok, I'll do! Link to comment Share on other sites More sharing options...
czardas Posted October 31, 2011 Share Posted October 31, 2011 (edited) How about this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Date.au3> #include <File.au3> $Form1 = GUICreate("Territories", 477, 237, 192, 124) $File = GUICtrlCreateMenu("&File") $Exit = GUICtrlCreateMenuItem("E&xit", $File) $Tools = GUICtrlCreateMenu("T&ools") $OverTime = GUICtrlCreateMenuItem("Ch&eck expiration", $Tools) GUISetState(@SW_SHOW) Dim $Form1_AccelTable[2][2] = [["!x", $Exit],["^h", $OverTime]] GUISetAccelerators($Form1_AccelTable) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Exit Exit Case $OverTime $file = FileOpen("C:Users\Utente\Documents\Date.txt") $AnyDate = FileReadLine($file,-1) FileClose($file) $TodayDate = _NowCalcDate() $AnyDate = StringMid($AnyDate, 7, 4) & "/" & StringMid($AnyDate, 4, 2) & "/" & StringMid($AnyDate, 1, 2) MsgBox(4096, "", "Date read: " & $AnyDate & @CRLF & _ "Today: " & _NowCalcDate() & @CRLF & _ "Difference in days: " & _DateDiff("d", $AnyDate, $TodayDate) & @CRLF & _ "Difference in months: " & _DateDiff("m", $AnyDate, $TodayDate)) EndSwitch WEnd Edited October 31, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Baster Posted October 31, 2011 Author Share Posted October 31, 2011 (edited) Did you know that AutoIt isn't case sensitive? That was the problem! If you see in the KODA GUI REGION you will see a variable, $File, that has the same name of our $file variable.. Thank you for all your time spent on this problem.. Thank you very much Edited October 31, 2011 by Baster Link to comment Share on other sites More sharing options...
czardas Posted October 31, 2011 Share Posted October 31, 2011 The code I just posted should be working. I never bothered with any of that KODA stuff. Some things are more sensitive than others. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now