Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
asynchronous flow control
View previous topic :: View next topic  
Author Message
rexford
Newbie


Joined: 20 Nov 2003
Posts: 6

PostPosted: Dec 2nd, 2003 01:32 PM    Post subject: asynchronous flow control Reply with quote

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
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Dec 3rd, 2003 08:09 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
rexford
Newbie


Joined: 20 Nov 2003
Posts: 6

PostPosted: Dec 3rd, 2003 04:24 PM    Post subject: Reply with quote

I tried. Still doesn't work

Thanks anyway.
_________________
Nothing is better than good thing...
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Dec 3rd, 2003 05:15 PM    Post subject: Reply with quote

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 Wink
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic