Loop ???

SoyEli

Active Member
Licensed User
Longtime User
Hello:

What is the best way for "Wait for line to execute"
I need a line to execute before continuing with the next one.
WITHOUT using Do-Loop" this locks up phone most of the time " even with DoEvents.

do you have an example?

Thank you :sign0085:
 

Jondroid

Member
Licensed User
Longtime User
Difficult to say with the amount of information you have provided. I could guess a number of things. So what would happen if you put the line into another thread and do in the main program simply a while loop which watches if a boolean variable has been changed. The content of the loop of course should contain DoEvents.

But this is all wild guessing. Please elaborate a bit on you problem, e.g. what is this "magic" line which takes so long. Will it update Objects on the Acitivty, ...

I worry that without those informations it will be rather tough to give you any meaning full answer.
 
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
Jondroid:

I have a "BlueAnt" BlueTooth.
When the Bluetooth detects the phone and connects, it tells me
So I want the phone "My Program" to wait about 4 seconds and also "TTS" speak the conformation out.
Also when a msg comes in, I want the name to be said first, and after 2 seconds
delay the msg read out.

Bottom line I need a ( WAIT ) sub for each or any line to execute.
Do-DoEvents-Loop works good but, it crashes phone from time to time.

example:
Sub Wait(MS As Long)
Dim now As Long
If MS > 5000 Then MS = 5000 'avoid application not responding error
now=DateTime.now
Do Until (DateTime.now > now + MS)
DoEvents
Loop
End Sub

Thank you:
 
Last edited:
Upvote 0

Jondroid

Member
Licensed User
Longtime User
I can't post my solution. (Can anyone please explain why I couldn't post the content of that message in here?)
 

Attachments

  • message.txt
    578 bytes · Views: 155
Upvote 0

SoyEli

Active Member
Licensed User
Longtime User
Thank you:

Not what I was looking for, but I Got it working with a timer.

Thank you for your HELP :)
 
Upvote 0
Top