| View previous topic :: View next topic |
| Author |
Message |
rexford Newbie
Joined: 20 Nov 2003 Posts: 6
|
Posted: Dec 2nd, 2003 01:32 PM Post subject: asynchronous flow control |
|
|
Hello, there!
For index = 1 to MaxNum
/DoSomething()
Text1.Text = index
Next index
When I run the code above, if the MaxNum is not large enough then Text1 will display the last index (MaxNum) only.
Is there any way that For-Loop waits until Text1.Text actually updates before it procedes to the next line?
I need to display each index in Text1.
Thanks in advance |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Dec 3rd, 2003 08:09 AM Post subject: |
|
|
Try adding a DoEvents after the line that you set the text :
| Code: |
For index = 1 to MaxNum
/DoSomething()
Text1.Text = index
DoEvents
Next index
|
_________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
rexford Newbie
Joined: 20 Nov 2003 Posts: 6
|
Posted: Dec 3rd, 2003 04:24 PM Post subject: |
|
|
I tried. Still doesn't work
Thanks anyway. _________________ Nothing is better than good thing... |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Dec 3rd, 2003 05:15 PM Post subject: |
|
|
You need a bigger delay. Here is one way :
| Code: | Private Sub Form_Activate()
For Index = 1 To 100
Text1.Text = Index
For i = 1 To 10000
DoEvents
Next
Next Index
End Sub |
You can also try the [api]Sleep[/api] API  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|