If I removed them, what would I use to indicate the stopping point for the loop?
Printable View
If I removed them, what would I use to indicate the stopping point for the loop?
Well then you have to work from the original type of project that you had, previously posted. Cause now I ruined it, because I had saved over it by mistake. So sorry...
It was a rhetorical response...
I need something in the code that indicates a stopping point. Otherwise, it's useless.
I guess, try it in the something like an event that doesn't have a Timer in it???Code:DoEvents
Could you go into further detail on DoEvents? I'm pretty new to VB.
Thank you.
Well it's very hard to describe what to use it for, seeing that it can be used for many types of purposes. Like animation and also network support, like a login script, etc...
don't fib and don't sugar coat it.... DoEvents is for one purpose and one purpose only... when you use DoEvents, you're telling the system "Hey, I'm not doing anything important at the moment, if you have any waiting message in the message queue, process them." That's what it does... It comes with a price... and more often not, a lot of unintended consequences. There is a reason why this thread made it up to two pages before the suggestions came up.
-tg
And that is, sorry I have only been working by myself today. Everyone's out of the Office...
my reply wasn't aimed at you... in was in direct response to theimp's suggestion of using doEvents... it's a slippery slope to start on... sometimes it becomes necessary, in which case, it can be used as long as you have a full and complete understanding of what it could do - specifically, releases the system to take action on other messages in the queue, which could include processing OTHER EVENTS in your app, that could cause you to end up someplace you're not prepared to be at yet.
That's all.
As for you issue specifically, I don't know. To be honest, I'm having trouble following the thread... so I'm leaving it in the (hopefully) capable hands of others who seem to have a better idea of what you're doing than I.
-tg
Well I guess that we could be able to get a Super Moderator to help us, but then that's the OP's decision, then not min to do???
I would like to try another route. Is there a way I could make the script stop when it reaches row 11 on the page?
But then that would be altering a long of source code. Also what are you going to skip from the line xyz to line 11???
Well then can't you use a GoTo I believe that you can use that in this type of instance or even a GoSub, either way???
My suggestion was something like this
Code:Sub TestGoTo()
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim ESC As String ' Chr(rcESC) = Chr(27) = Control-[
ESC = Chr(Reflection2.ControlCodes.rcESC)
With Session
StartLoop:
.TransmitTerminalKey rcVtUpKey
If .StatusBar <> "" Then
GoTo ExitLoop
Else
.TransmitTerminalKey rcVtSelectKey
.TransmitTerminalKey rcVtRemoveKey
.Transmit CR
'.StatusBar = ""
.Transmit "Y"
'.StatusBar = ""
.Transmit CR
End If
GoTo StartLoop
ExitLoop:
Debug.Print .StatusBar ' display the contents of StatusBar in the Immediate Window
.Transmit CR
.Transmit CR
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
End With
End Sub
I guess that you could be able to make it loop over on Line 11, but then what is so special about line 11???
So sorry, I keep making that kind of mistake!!
Update:
I tried the script Doogle provided, it seems to ignore the commands that include .StatusBar and continue looping.
Retro fit your source code that you had in the first place and then add in the looping source code to it. Then it will do both and then see what happens then???
Use the source code that you have about the looping and then add it to the source code that you had before hand that worked without it. Then you should be able to have a working demo product of your program. That worked for me on some occassions, but then I stongly suggest to backup both of the projects, at that...