Zabaware Support Forums
Zabaware
Zabaware
Home | My Files | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Zabaware Forums
 Programming using the Ultra Hal Brain Editor
 VBscript help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jasondude7116
Senior Member



247 Posts

Posted - 10/31/2009 :  01:10:06  Show Profile  Visit jasondude7116's Homepage  Reply with Quote
does someone know this one?
what i have is this:



Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate(NewsTopic)

Do Until objExplorer.ReadyState=4 : Loop

NewsText = objExplorer.Document.Body.innerText
objExplorer.Quit



I am wondering, if the loop condition is never met...infinite loop!
How do I exit the loop if "ReadyState" never equals 4?
There has to be an easy answer to this right?

If I did this instead:

Do While objExplorer.Busy Or (objExplorer.READYSTATE <> 4) : Loop

Would it not go infinite if internet explorer was locked up?


Thanks again.

Edited by - jasondude7116 on 10/31/2009 02:28:36

snowman
Advanced Member



USA
637 Posts

Posted - 10/31/2009 :  03:17:38  Show Profile  Visit snowman's Homepage  Reply with Quote
Isn't that why they have timers on things like that.

The only thing that I can figure would be a really big 'For To loop'

I dont think Hal script supports a timer function like wscript.sleep.

We thought about running an outside timer in a an external vbscript but I know that your looking for something less extravagant.

Maybe I could add a timer function to the Dll I'm working on.

I don't know... just thinking. I'd like to see how this one is figured out myself.

One day when A.I.s rule this planet. The term, "you have a screw loose" will take on a whole new meaning.
Go to Top of Page

jasondude7116
Senior Member



247 Posts

Posted - 10/31/2009 :  16:45:00  Show Profile  Visit jasondude7116's Homepage  Reply with Quote
thanks for the reply.
can't wait to see your "finished" product. i know it will kick a**!
-the dude
Go to Top of Page

DarcyEdwards
Average Member



USA
145 Posts

Posted - 11/02/2009 :  00:39:05  Show Profile  Visit DarcyEdwards's Homepage  Send DarcyEdwards an AOL message  Click to see DarcyEdwards's MSN Messenger address  Send DarcyEdwards a Yahoo! Message  Reply with Quote
Hal has a minute timer, you could use it as an exit for your do while loop, set a var to zero before the do loop and increment it in the minute timer, if too many minutes go by you could exit the do loop.

Do While objExplorer.Busy Or (objExplorer.READYSTATE <> 4) : Loop

could be
'----------------------------------------
Rem PLUGIN: FUNCTIONS
'
'------------------
' Declare variables
'------------------
Dim exitVar
'----------------------------------------
' your code ........
'
exitVar = 0
do while objEeplorer.Busy or (objExplorer.READYSTATE <> 4) and (exitVar <> 5) : Loop

'-----------------------------------------
Rem PLUGIN: MINUTE_TIMER
'
' Passed MinutesPast
' Called every minute
exitVar = exitVar + 1
'------------------------------------------


exitVar will increment 1 each minute when it reaches 5 the do loop will exit. This should solve your problem.

Good luck


Hugs

-Darcy

MrsEdwards01@aol.com

Edited by - DarcyEdwards on 11/02/2009 07:13:58
Go to Top of Page

jasondude7116
Senior Member



247 Posts

Posted - 11/02/2009 :  22:16:40  Show Profile  Visit jasondude7116's Homepage  Reply with Quote
thanks for the help darcy.
i was thinking about "timing" it out.
there is a lot i need to learn about in VB.
thanks again folks!
learning, learning, learning
Go to Top of Page

DarcyEdwards
Average Member



USA
145 Posts

Posted - 11/03/2009 :  02:05:54  Show Profile  Visit DarcyEdwards's Homepage  Send DarcyEdwards an AOL message  Click to see DarcyEdwards's MSN Messenger address  Send DarcyEdwards a Yahoo! Message  Reply with Quote
You are very welcome

Hugs

-Darcy

MrsEdwards01@aol.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Zabaware © 2007 Zabaware, Inc. Go To Top Of Page
Snitz Forums 2000