哦,好象是这样的。
我再去试试。谢谢
zhsu(做人Bata版) 你说的判断是不是指判断串口缓冲池内到的数据够不够?

解决方案 »

  1.   

    现在问题又来了,我的程序要可以接收两种不同字节数的数据。
    于是我在ONCOMM中加了这么一段程序:
       if x=0 then    ;x是判断进来的数应该是几个字节,初始为0
         do 
         doevents
         loop until .inputbuffercount>=3
       elseif x=1 then
          do 
          doevents
          loop until .inputbuffercount>=9
       end if
         x=0
        av=.input
        ab(0)=av                         ;又显示下标越界不过以前那个接受9个字节的程序却不显示这样的错误
    这究竟是为什么啊?
      

  2.   

    u can use this to declare the ab arraydim ab( 0 to 10 ) as byteif u use dim ab(10) as byte may be like this dim ab( 1 to 10 ) as byte.
      

  3.   

    你的AB()怎么定义的啊?
     dim ab(0 to 9) as byte
      

  4.   

    你ab(0)
      av  
    是如何定义的?
      

  5.   

    dim a as string*20
    for i=1 to 10
    ab(i)=cbyte(mid(a,i,2))
    next
    你可以试一试