我第一次开发 vb 6.0 应用程序时,我试图在 VB 6.0 中将大小为 (164999) 的巨大字节数组转换为长/整数数组,但它给了我一个溢出错误。
我的代码
Dim tempByteData() As Byte // of size (164999)
Dim lCount As Long
Private Sub Open()
lCount = 164999 **//here I get the count i.e. 164999**
ReDim tempByteData(lCount - 1)
For x = 0 To obj.BinaryValueCount - 1
tempwaveformData(x) = CByte(obj.BinaryValues(x))
Next
tempByteData(lCount - 1) = BArrayToInt(tempByteData)
End Sub
Private Function BArrayToInt(ByRef bArray() As Byte) As Long
Dim iReturn() As Long
Dim i As Long
ReDim iReturn(UBound(bArray) - 1)
For i = 0 To UBound(bArray) - LBound(bArray)
iReturn(i) = iReturn(i) + bArray(i) * 2 ^ i
Next i
BArrayToInt = iReturn(i)
End Function
需要做什么才能将所有字节数组数据转换为长/整数数组或任何替代方式来存储这些字节数组,以便不会发生溢出异常