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

[AU3基础] 怎样避免请求于对象错误?

[复制链接]
发表于 2012-3-26 19:41:35 | 显示全部楼层 |阅读模式
从学习AU3这段时间里,自己写的代码很多时候都会弹出,请求于对象错误。

比如这个例子:
网页源码是这样的
<link href="css.css" rel="stylesheet" type="text/css" />
<link href="css.css" rel="stylesheet" />
程序是这样的:
    If WinExists("[CLASS:IEFrame]") = 1 Then
        $IEWinList = WinList("[CLASS:IEFrame]")

        For $i = 1 to $IEWinList[0][0]
            $oIE = _IEAttach($IEWinList[$i][1], "HWND")
            If $oIE <> 0 Then
               $oEmbeds = _IETagNameGetCollection($oIE, "link")
                If $oEmbeds <> 0 Then
                    For $oEmbed In $oEmbeds
                    msgbox(4096,"",$oEmbed.type)
                     $oEmbed.type = "test"
                EndIf
            EndIf
         Next
    EnfIf

循环第一次没有问题。有type变量,可是循环第二次就出问题了,弹出请求于对象错误。
我怎样能很安全的执行这段代码呢?也就是说怎样检测每次执行的$oEmbed.type 是否存在,是否有值?
 楼主| 发表于 2012-3-27 00:30:01 | 显示全部楼层
求帮组啊!
 楼主| 发表于 2012-3-27 19:07:06 | 显示全部楼层
有没有谁能告诉我$oEmbed.type这种变量是什么类型啊?
用isobj($oEmbed.type)检测不出来,isstring($oEmbed.type)也检测不出来
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 17:59 , Processed in 0.078959 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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