找回密码
 加入
搜索
查看: 988|回复: 1

大家帮我看看这段代码

[复制链接]
发表于 2009-7-11 18:13:19 | 显示全部楼层 |阅读模式
本帖最后由 xg911335 于 2010-2-2 13:26 编辑

我写了一个提醒小工具,代码如下,麻烦各位指点一下,看看能不能写得更加简洁或适当的修改运行效率更高,暂用CPU更少。尤其是反复的判断能不能更简洁一些。
While 1
          $input = InputBox("时间提示工具","请在0-9中输入4位整数"& @CR & @CR &"例如11:50输入1150,如19:04=1904","","","240","135")
        If @error = 1 Then
                Exit
        EndIf
        $strlen = StringLen($input)
        If $input = "" Then
                MsgBox(0,"时间提示","你没有输入任何数字,请重新输入")
        ElseIf StringIsDigit($input) <> 1 Then
                MsgBox(0,"提示","您输入的包涵其它字符")
        ElseIf $strlen <> 4 Then
                MsgBox(0,"提示","请重新输入4位整数")
        Else
                ExitLoop
        EndIf
       
WEnd
       

While 1
If @HOUR&@MIN = $input then
        MsgBox(0,"","时间到了")
        ExitLoop
EndIf
Sleep(5000)
WEnd
发表于 2009-7-13 14:52:35 | 显示全部楼层
用宏非常之慢,你用API的时间函数吧
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-5 04:50 , Processed in 0.069870 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表