Internet Direct (Indy)
|
Reads and optionally removes a Word value from the internal storage for the buffer.
function ExtractToWord( const AIndex: Integer ): Word;
Parameters |
Description |
AIndex |
Postion in the buffer where bytes for the data type are stored. |
Word - Value read from the internal storage for the buffer.
ExtractToWord is a Word function used to read and optionally remove a Word value from the internal storage for the buffer.
AIndex is the zero-based offset of the byte value to extract from the internal storage for the buffer. AIndex normally contains a value in the range 0 (zero) to Size-1. When AIndex contains 0 or a positive value, the content in the buffer is not altered by the Extract operation.
Using a negative value in AIndex indicates that data is being accessed sequentially and calls Remove to adjust the current buffer position and the space allocated for the buffer by the size for the ordinal data type.
ExtractToWord calls the BytesToWord routine to convert the byte values in the buffer to the ordinal data type. The converted data type is adjusted from network byte order to host-specific byte order using the NetworkToHost method in GStack for the operating system or platform.
Use one of the other Extract methods to read a specific data type from the internal storage for the buffer:
Method |
Storage Data Type |
String | |
Byte | |
Cardinal | |
Int64 | |
ExtractToWord |
Word |
Exceptions |
Description |
Raised with RSNotEnoughDataInBuffer and the requested byte count. |
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved. Website http://www.indyproject.org. Post feedback to the Indy Documentation newsgroup. |