zunebuggy65
Active member
- Joined
- Oct 12, 2023
- Messages
- 42
- Programming Experience
- 3-5
I am getting an exception with the following:
'Object reference not set to an instance of an object' on the line that is 'ByteArry(x) = mrv' I realize that this error means I did not declare the variable, but I did declare it. I tried both As Integer and As Byte and neither worked.
Thank you.
VB.NET:
Dim ByteArry() As Integer
' Or Dim ByteArry() As Byte
Dim binWrite as BinaryWriter
for x = 0 to 99
mrv = 0 + 100 'Any byte (0-255)
ByteArry(x) = mrv
next x
binWrite = New BinaryWriter(File.Open(myFilNam, FileMode.Create))
Using binWrite
For x = 0 to 99
binWrite.Write(ByteArry)
Next x
End Using
binWrite.Close()
'Object reference not set to an instance of an object' on the line that is 'ByteArry(x) = mrv' I realize that this error means I did not declare the variable, but I did declare it. I tried both As Integer and As Byte and neither worked.
Thank you.