Re: appendChunk method resulting in incorrect data
- From: everymn@xxxxxxxxx
- Date: Sat, 23 Jun 2007 00:43:56 -0500
Steven,
Correct, my bad, when I dim arr(10) I was ending up with 11 extra
bytes in the data. I actually don't want any bytes though.
I'm just returning this array for use reading a binary file and then
saving that data to an ADO parameter using appendChunk. So I have two
dilemma's, first why does the append function flip out and say that
the data type is wrong when I have the DLL return arr() as byte?
Second even if I do return it as arr(0) as byte, why isn't appendChunk
initialiing the array and writing over that first 0 the first time I
call it? As a result of this when I write say 500 bytes I end up with
501 in the data source, and an invalid file.
Thanks
Eric
.
It has been a while since I worked with VB.
I am uncertain of this but I think you are getting 1 more byte because of
the 0 lower bound.
If you do
Dim arr(10) As Byte
that is equivalent to
Dim arr(0 to 10) As Byte
which is 11 elements, not 10.
So you want
Dim arr(1 to 10) As Byte
Dim arr(0 to 9) As Byte
for 10 elements
Stephen Howe
- Follow-Ups:
- References:
- appendChunk method resulting in incorrect data
- From: everymn
- Re: appendChunk method resulting in incorrect data
- From: everymn
- Re: appendChunk method resulting in incorrect data
- From: Stephen Howe
- appendChunk method resulting in incorrect data
- Prev by Date: Re: appendChunk method resulting in incorrect data
- Next by Date: Re: appendChunk method resulting in incorrect data
- Previous by thread: Re: appendChunk method resulting in incorrect data
- Next by thread: Re: appendChunk method resulting in incorrect data
- Index(es):
Relevant Pages
|
|