大家是如何处理接收缓冲区内的数据???例如假设接收缓冲区,需要处理这段字符:+CMTI: "SM",4我的程序大致为
...
        mscomm1.InputLen = 1
        mscomm1.RThreshold = 0
...
        dim strBuffer as string
....
        do   
            strBuffer =strBuffer +mscomm1.input
        loop   until   instr(aa,"+CMTI:")
....上面的代码可以正常截获"+CMTI:"部分,但后面的"SM",4应该如何获取??

解决方案 »

  1.   

    当然收不到啦,你收到CMTI的时候就退出循环了
      

  2.   

    我的程序大致为  
    ...  
                   mscomm1.InputLen  =  1  
                   mscomm1.RThreshold  =  0  
    ...  
                   dim  strBuffer  as  string  
    ....  
                   do        
                           strBuffer  =strBuffer  +mscomm1.input  
                   loop      until      instr(strBuffer  ,"+CMTI:")  
    ....
      

  3.   

    试试:
            do   
                strBuffer =strBuffer +mscomm1.input
            loop   until   instr(aa,vbCrLf)
      

  4.   

    Dim t1, t2 As String   If (InStr(strBuffer, "+CMTI") > 0) Then
            Text2 = Text2 & strBuffer
            t1 = Split(strBuffer, " ")(0)
            t2 = Split(strBuffer, " ")(1)
       endif意思是如果想全部取出,就整个放到字符里,根据回车符来读取完整数据。