Jump to content

how to Detect IsObj or NOT IsObj ???


Recommended Posts

hi.

how to make this code run like :

if $SPan is TRUE (found the button) then CLICK on it and refresh the page.., if $SPan is FALSE (Not found the button) then doing something else.

==edited==

in that code if $SPan is TRUE then it will CLICK and Refresh it. but after that it will call 

consolewrite("TOmbol SAM Tidak muncul / EROORRRR"&@CRLF)

how to make the code that could not called it if it TRUE COndition (OBJ $SPan)?

Edited by Tripoz
Link to comment
Share on other sites

  • Moderators

Did you look at the help file for _IEGetObjByID()? What does it tell you happens if it fails? Perhaps that gives you an idea of what you can do?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Why not, instead of using Not IsObj($Span) use:

while 1
   $Span = _IEGetObjById($oIE, "sell_at_market")
   ;sleep(4000)

   Select
   case IsObj($Span)
      consolewrite("TOmbol SAM muncul"&@CRLF)
      _IEAction($Span, "click")
      sleep(10000)
      _IENavigate($oIE, $url)
      ;_IEAction($Span, "refresh")
   Case @Error
        consolewrite("TOmbol SAM Tidak muncul / EROORRRR"&@CRLF)
        
   EndSelect

WEnd; IsObj($Span)

As the return value on _IEGetObjById for an error is to set @Error flag to a non-zero value.

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Did you look at the help file for _IEGetObjByID()? What does it tell you happens if it fails? Perhaps that gives you an idea of what you can do?

 

 

thx so much...

its like @error = 7 right?

Edited by Tripoz
Link to comment
Share on other sites

  • Moderators

And under that, what does it say for @error = 3, and @error = 7? And does that match up with what you're seeing?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...