0

这是我的代码:

IniRead, intLastMyDate, c:\temp\test.ini, section1, intLastMyDate, 130101

formattime, intCurrentMyDate, A_Now, yyMMdd

; if the ini has a date stored that is less than today, I will want to 
;    include code that restarts some other variables for a new day
; but if the date is the same as today, I want to leave those values alone,
;    no matter how many times I reload the script after fiddling with the code
if intLastMyDate < intCurrentMyDate
   {
   IniWrite, %intCurrentMyDate%, c:\temp\test.ini, section1, intLastMyDate
      ; following just to show failure of test to do what I expect
   MsgBox, if condition evals %intLastMyDate% < %intCurrentMyDate% as true
   }

我第一次加载脚本时,结果如预期。当我重新加载它时,它似乎在认为130510(我发布这个的那天)小于130510。这是一个数据类型的问题吗?帮助说任何看起来像数字的东西都被视为数字......

4

1 回答 1

0

换一行:

if (intLastMyDate < intCurrentMyDate)
于 2013-05-10T19:31:08.793 回答