AutoHotKey:iniwrite然后读取formattime与formattime的结果不一样

时间:2013-05-10 17:07:17

标签: autohotkey ini

这是我的代码:

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.这是一个数据类型问题吗?帮助说任何看起来像数字的东西都会变成一个数字......

1 个答案:

答案 0 :(得分:0)

更改一行:

if (intLastMyDate < intCurrentMyDate)