Buffer: GetByte

GetByte

Returns a the byte value at the given byte index within an array.



 Public Function GetByte(
	  ByRef Arr As Variant,
	  ByVal Index As Long ) As Byte

Parameters

Arr
[ByRef] Variant. The array to retrieve the byte value from.
Index
[ByVal] Long. The byte index to read the byte at.

Return Values

Byte -  The byte value from within the array.

Remarks

The index is based on bytes, not the size of the actual array elements. For example: if getting the byte from a Long array at index 3, then the upper 8-bits of the first element will be returned.

The lower-bound of the array is ignored. Index begins at 0.

Exceptions

ExceptionCondition
ArgumentNullExceptionArr is unintialized.
ArgumentExceptionArr is not an array.
ArgumentOutOfRangeExceptionIndex is negative or greater than the length of Arr.

See Also

Project CorLib Overview

Class Buffer Overview