Can someone translate this doc snippet to English...?

  • Thread starter Thread starter Jeff Johnson
  • Start date Start date
J

Jeff Johnson

I was reading the MSDN documentation for the Buffer.BlockCopy method. Here's
a piece from the current (3.5) version:

============
The BlockCopy method accesses the bytes in the src parameter array using
offsets into memory, not programming constructs such as indices or upper and
lower array bounds. For example, if in the programming language of your
application you declare an Int32 array with a zero-based lower bound of -50,
then pass the array and an offset of 5 to the BlockCopy method, the first
array element the method will access is the second element of the array,
which is at index -49. Furthermore, which byte of array element -49 is
accessed first depends on the endianess of the computer executing your
application.
============

"zero-based lower bound of -50"? WTF? Isn't the phrase "zero-based" just a
shorthand for "lower bound of zero"?
 
Jeff Johnson said:
I was reading the MSDN documentation for the Buffer.BlockCopy method.
Here's a piece from the current (3.5) version:

============
The BlockCopy method accesses the bytes in the src parameter array using
offsets into memory, not programming constructs such as indices or upper
and lower array bounds. For example, if in the programming language of
your application you declare an Int32 array with a zero-based lower bound
of -50, then pass the array and an offset of 5 to the BlockCopy method,
the first array element the method will access is the second element of
the array, which is at index -49. Furthermore, which byte of array
element -49 is accessed first depends on the endianess of the computer
executing your application.
============

"zero-based lower bound of -50"? WTF? Isn't the phrase "zero-based" just a
shorthand for "lower bound of zero"?


It would seem that "zero-based" does not belong in that sentance. I think
the caveat is trying to cover any language (F# ?) that allows for non-zero
lower bounds. It's strange though that not many other doc sections have
this type of paragraph.
 
"zero-based" refers probably to the memory offset, meaning that at offset 0
you find the lower bound element of the array. In some constructs (some kind
of variable arrays), you might well find something else like the actual size
of the array (and the lower bound element at offset +4 for example). You
also might imagine array where the offset zero is the upper bound element
and stored backward and so on.

/LM
 
Back
Top