Topic Path: Symbol Reference > Functions > ToBytes Function (TIdBytes, Integer)
ToBytes Function

Converts the data type to a TIdBytes value.

function ToBytes(
    const AValue: TIdBytes; 
    const ASize: Integer
): TIdBytes; overload;
Bytes values to be converted.
Number of bytes to include in the converted data type. 

TIdBytes - Results of the data type conversion.

ToBytes is an overloaded TIdBytes function used to convert the TIdBytes value in AValue up to and including the number of byte values specified in ASize. 

Since AValue is already a TIdBytes data type, no real conversion is required. The return value for the function is resized to the value in ASize, and CopyTIdBytes is called to copy the number of bytes in ASize from AValue into the return value for the function.

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