Sign in to follow this  
shinex

vb6 DoEvents

Recommended Posts

shinex    122
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
shinex    122
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this