Jump to content
Sign in to follow this  
Tripoz

how to Detect IsObj or NOT IsObj ???

Recommended Posts

Tripoz

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

Share this post


Link to post
Share on other sites
JLogan3o13

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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
MikahS

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

 

Share this post


Link to post
Share on other sites
Tripoz

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

Share this post


Link to post
Share on other sites
JLogan3o13

What does the help file say?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Tripoz

What does the help file say?

Failure:sets the @error flag to non-zero

 

Share this post


Link to post
Share on other sites
JLogan3o13

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


√-1 2^3 ∑ π, and it was delicious!

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  

×