Converts a TIdByte value to the ordinal datatype.
function BytesToInteger( const AValue: TIdBytes; const AIndex: Integer = 0 ): Integer;
Parameters |
Description |
AValue |
Values to be converted. |
AIndex |
Initial position in the array of bytes to use when converting bytes value to the ordinal data type. Default value is 0. |
Integer - Value for the converted ordinal data type.
BytesToInteger is a utility function used to convert byte values specified in AValue to the ordinal data type.
AIndex is a zero-based offset into the array of bytes to use when converting byte values to the ordinal data type.
Please note that AValue must have an allocated size large enough to store the ordinal data type beginning at the offset indicated in AIndex. When AValue is too small, an EAssertionFailed exception will be raised and the return value for the function is 0 (zero).
For the .Net platform, the ToInt32 method from the FCL System.BitConverter class is called to prepare the return value for the function.
For all other platforms where point operations are supported, the return value is derived by casting and de-referencing a pointer for the ordinal data type using the byte values at the specified offset into the array of bytes.
Use one of the following utility functions to convert byte values in a TIdByte data type to another ordinal datatype:
Exceptions |
Description |
EAssertionFailed |
Raised when the array of bytes is too small to store all bytes required to represent the ordinal data type at the indicated offset into the array of bytes. |
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
|
Post feedback to the Indy Docs Newsgroup.
|