界面略
先用Ini*函数读取配置文件成以下方便取值的数据,然后在需要的时间点在数据中正则匹配,简单可靠#include <Array.au3>
Local $sSource = _
'Object1.CaseA = 8:00|12:00|18:00|24:00' & @CRLF & _
'Object1.CaseB = 22:00' & @CRLF & _
'Object2.CaseA = 8:00|12:00|16:00|22:00|24:00' & @CRLF & _
'Object2.CaseB = 8:00|12:00|17:30' & @CRLF & _
'Object2.CaseC = 8:00|17:30' & @CRLF & _
'Object3.CaseA = 8:00|12:00|16:00|22:00|24:00' & @CRLF & _
'Object3.CaseB = 8:00|12:00|17:30' & @CRLF & _
'Object3.CaseC = 8:00|17:30' & @CRLF & _
'Object3.CaseD = 8:00|18:00|24:00'
;~MsgBox(0, '源字符串', $sSource)
Local $sTime = InputBox('提醒测试', '请输入测试时间', '12:00')
If @Error Then Exit
Local $aSRE = StringRegExp($sSource, '(?m)(^.+?)\h*\=\h*.*?\D' & $sTime & '\D', 3)
If @Error Then Exit MsgBox(48, $sTime, '该时间点无提醒事件')
_ArrayDisplay($aSRE, UBound($aSRE))
|