Sign in to follow this  
Followers 0
ajdicky

Help please!

4 posts in this topic

#1 ·  Posted (edited)

$DWLUMBER = _IEAttach("Lumber Mill")

$DWSTARTLUMBER = "We need some spare people around here"

$oLinks = _IELinkGetCollection($DWLUMBER)

For $oLink in $oLinks

$sLinkText = _IEPropertyGet($oLink, "innerText")

If StringInStr($sLinkText, $DWSTARTLUMBER) Then

_IEAction($oLink, "click")

ExitLoop

EndIf

Next

Could anyone please tell me whats does this line mean?

For $oLink in $oLinks

and what is $oLink in $oLinks?

cause sometimes i try to make another same loop on the same script and change $oLink in $oLinks to another name like $oAink in $oAinks and

it pops up error saying this

For $oLink in $oLinks

For $oLink in $oLinks^ ERROR

Error: Variable must be of type "Object".

Edited by ajdicky

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I'm Sorry but its a same topic but not a same question!

Edited by ajdicky

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You need error checking after _IEAttach to ensure that it is successful.

$DWLUMBER = _IEAttach("Lumber Mill")
If @ERROR Then
MsgBox(0,"","Failed to attach to Internet Explorer window")
Exit
EndIf

$DWSTARTLUMBER = "We need some spare people around here"

$oLinks = _IELinkGetCollection($DWLUMBER)
If @ERROR Then
MsgBox(0,"","Failed to attach to retrieve link collection")
Exit
EndIf

For $oLink in $oLinks
    $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $DWSTARTLUMBER) Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next
Edited by weaponx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0