【问题标题】:AutoHotKey: iniwrite then read of formattime not the same as result of formattimeAutoHotKey:iniwrite 然后读取 formattime 与 formattime 的结果不同
【发布时间】:2013-05-10 17:07:17
【问题描述】:

这是我的代码:

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

【问题讨论】:

    标签: autohotkey ini


    【解决方案1】:

    换一行:

    if (intLastMyDate < intCurrentMyDate)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-22
      • 1970-01-01
      • 1970-01-01
      • 2015-09-29
      • 2017-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多