这是我的代码:
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.这是一个数据类型问题吗?帮助说任何看起来像数字的东西都会变成一个数字......
答案 0 :(得分:0)
更改一行:
if (intLastMyDate < intCurrentMyDate)