Topic Path: Symbol Reference > Functions > CopyBytesToHostCardinal Function
CopyBytesToHostCardinal Function

Converts binary values from network byte order to host-specific byte order for the data type.

procedure CopyBytesToHostCardinal(
    const ASource: TIdBytes; 
    const ASourceIndex: Integer; 
    var VDest: Cardinal
Array of bytes to convert.
Initial byte position for the conversion.
Storage for the converted values. 

CopyBytesToHostCardinal is a procedure used to convert the bytes representing a Cardinal value in ASource from their representation in Network byte order to the byte ordering used on the platform hosting the Indy library. 

CopyBytesToHostCardinal is used to convert the binary values in ASource, and calls the NetworkToHost method in the TIdStack descendant for the platform to access the ntohs, ntols, htons, and htons functions implemented for the protocol stack. 

ASourceIndex indicates the initial bye position in ASource to be read and converted in the method. 

ADest is the Cardinal value used to store bytes after conversion using the NetworkToHost method in TIdStack

CopyBytesToHostCardinal is used in the implementation of protocol clients like TIdSNTP and TIdFSP where the byte ordering in integer values differ in the usage and transmission formats of the data type. 

CopyBytesToHostCardinal is not declared in the IdGlobal.pas unit because unit references needed for TIdStack and other descendants are not already included in that unit.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.