Jump to content
  • Advertisement
Sign in to follow this  
shinex

vb6 DoEvents

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi people. I got a source code in which i need to use the DoEvents so that when the at command sends back an ok, i can display the other data out on the textbox. I need to know the response too.

Share this post


Link to post
Share on other sites
Advertisement
ok my code are as follows:

Private Sub write_Click()
state = 5
For z = 2 To j
If InStr(names(z), "+CPBR:") Then
k = InStr(names(z), "+CPBR:")
If k > 0 Then
Mid$(names(z), k, 6) = " "
End If


MSComm1.Output = "AT+CPBW=" + names(z) & vbCrLf
End If



Text1.Text = Text1.Text + names(z)

Next

End Sub


I'm using AT command to read the contacts from a mobile phone and then stored into an array. Now the result is that when I do the codes above, it will display: for instance:

AT+CPBW= 7,"88889999",129,"junwei carol/M"

OK
AT+CPBW= 57,"9252545345",129,"lala/H"

OK
AT+CPBW= 99,"6523434",129,"boo/H"

OK
AT+CPBW= 141,"98222222",129,"john hp/M"

OK
AT+CPBW= 173,"96333445",129,"julia hp/M"

OK
AT+CPBW= 204,"97977788",129,"liang zheng hp/H"

OK


They will send "ok" when we put vbCrlf. but I want it to display in sequence like AT+CPBW= 1,"99989",129,"eg/h"
ok
den 2...till 250
There will be a response time in between that causes the irregular intervals.


How do I solve the problem so that they can loop and display everything?
Should I use DoEvents or Timer or Sleep?
By the way, Im using VB6.
Please help.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!