Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Make a timer and on that timer check the status, instead of the loop.</p> <p>Solved after comment that explained where the data was coming from (async COM component's property):</p> <blockquote> <p>working with vb6 IDE on a realtime client-server project. I have to read some variables and when one of these changes status it sends a socket message to server. With the sleep it stuck equally</p> </blockquote> <p>What did not help: DoEvents and sleep</p> <pre><code> DoEvents Sleep 100 </code></pre> <p>might help, will need to refer to the windows function sleep. But VB6 is single thread (well one for UI and one for logic) so you should have a way to get out of the loop. What are you really trying to do? Can you describe at a top level?</p> <p>Are you working on the VB6 IDE or in VBA code in Office?</p> <p>For sleep to work declare:-</p> <pre><code>Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) </code></pre> <p>See this too <a href="https://stackoverflow.com/a/4540553/1643558">https://stackoverflow.com/a/4540553/1643558</a></p> <p>If your showing a form to the user to read value 1 and 2 then you can use a modal form and have a button to click when they are done, and hide the form only when you like the values. No need to have a loop then. Can show an error MsgBox on a modal form too.</p> <p>See <a href="http://www.tek-tips.com/viewthread.cfm?qid=1117372" rel="nofollow noreferrer">http://www.tek-tips.com/viewthread.cfm?qid=1117372</a></p> <p>Maybe remove the sleep and only keep the DoEvents. </p> <p>You could also make a timer and on that timer check the status, instead of the loop</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload