changing values in byte array - [RESOLVED]
Hi,
I have a byte array which I would like to For-Next through byte by byte and change values as needed then write this array into an existing file.
Here's the code I'm using. It does not currently work. It breaks on line: Put tfNewArray(), tfParInt, BGColRef
I was using Put to change the value in the file directly but this is very slow. But I don't know what the equilivant to "Put" is when dealing with a byte array.
Thanks for any help.
- Jake
VB Code:
Dim tfParInt As Long
Dim rByteValHex_1 As Byte
Dim rByteValHex2 As Byte
Dim tfBGColRef As Byte
Dim tfOthColRef As Byte
Dim tfNewArray() As Byte
ReDim tfNewArray(BOB_p1 To lngFileLen)
tfBGColRef = 0
tfOthColRef = BOB_FstByteColTblRef
Seek #f, BOB_p1
For tfParInt = BOB_p1 To lngFileLen
rByteValHex_1 = argArray_raster(tfParInt)
If rByteValHex_1 = BOB_FstByteColTblRef Then
'MsgBox ("here 1")
Put tfNewArray(), tfParInt, tfBGColRef
GoTo NexttfParInt
Else
If rByteValHex_1 = 0 Then
Put tfNewArray(), tfParInt, tfOthColRef
End If
End If
NexttfParInt:
Next tfParInt
Put #f, BOB_p1, tfNewArray()