总提示上标过界,百度了没找到对应的

总提示下标过界,百度了没找到对应的Public Function frame_very(pbuf() As Byte, dlen As Byte) As Boolea

总提示下标过界,百度了没找到对应的
Public Function frame_very(pbuf() As Byte, dlen As Byte) As Boolean
  Dim rtn As Boolean
  Dim ppbuf() As Byte
  Dim i As Integer
  rtn = False
  For i = 0 To 2
  ppbuf(i) = pbuf(i + 1)'就是后面这个数组显示下标过界
  Next

[解决办法]
用ubound判断下pbuf的上限