找回密码
 加入
搜索
查看: 1592|回复: 2

请帮忙把以下的代码精简一下,本人能力有限

[复制链接]
发表于 2008-7-16 09:36:52 | 显示全部楼层 |阅读模式
if $lineold1="B霸王大陆"      then
                                                        ;;_RefreshSystemTray()
                                                        $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                    _bwdl($nname,$path)  
                                                endif
                                                if $lineold1="B飚车"           then         
                                                                                            ;_RefreshSystemTray()
                                                    $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                    _bc($nname,$path)  
                                                endif  
                                                  if $lineold1="C传奇世界"  then         
                                                   ;_RefreshSystemTray()
                                                    $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                   
                                                   _cqsj($nname,$path)  
                                                endif
                                                if $lineold1="C彩虹岛online"  then         
                                                   ;_RefreshSystemTray()
                                                   
                                                        $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)  
                                                     
                                                   _chd($nname,$path)  
                                                endif
                                                if $lineold1="C赤壁"  then         
                                                   ;_RefreshSystemTray()
                                                   $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                     
                                                   _cb($nname,$path)  
                                                endif
                                               if $lineold1="C超级乐者"  then         
                                                   ;_RefreshSystemTray()
                                                   $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                     
                                                   _cjyz($nname,$path)  
                                                endif
                                              if $lineold1="C超级武林大富翁"  then         
                                                   ;_RefreshSystemTray()
                                                   $num+=1
                                                   TrayTip("游戏更新", "现在更新的游戏是:"&$name, "", 1)
                                                     
                                                   _cjwldfw($nname,$path)  
                                                endif
觉得重复的语句太多了

[ 本帖最后由 wdjking 于 2008-7-21 22:07 编辑 ]
发表于 2008-7-16 11:59:55 | 显示全部楼层
提供一种思路,本人对Call语法不熟悉,仅供参考。
Global $nname, $path
$lineold1 = StringSplit("B霸王大陆,B飚车,C传奇世界,……", ",")
$lineold2 = StringSplit("_bwdl,_bc,_cqsj,……", ",")
For $i = 1 To $lineold1[0]
        _Exectd($lineold1[$i], $lineold2[$i])
Next

Func _Exectd($sa, $sb)
        Local
        If $sa Then
                ;;_RefreshSystemTray()
                $num += 1
                TrayTip("游戏更新", "现在更新的游戏是:" & $name, "", 1)
                Call($sb & " ($nname, $path)")
        EndIf
EndFunc   ;==>_Exectd


[ 本帖最后由 bigger 于 2008-7-16 12:01 编辑 ]
 楼主| 发表于 2008-7-21 22:06:37 | 显示全部楼层

回复 2# bigger 的帖子

我觉得思路倒是可以,
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 10:23 , Processed in 0.070331 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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