Type conversion routines

From RAD Studio
Jump to: navigation, search

Go Up to API Categories Index

This topic lists all type conversion routines included in the Delphi run-time library.

Miscellaneous routines

The following table lists all routines with no particular category used to convert a type to another:

Routine Description

System.Classes.BinToHex

Converts a binary value into its hexadecimal representation.

System.Types.Bounds

Returns the Types.TRect for a rectangle of given dimensions.

System.Classes.HexToBin

Converts a string of hexadecimal digits to the corresponding binary value.

System.Types.Point

Creates a Types.TPoint structure from a pair of coordinates.

System.Types.Rect

Creates a Types.TRect structure from a set of coordinates.

System.Types.SmallPoint

Creates a Types.TSmallPoint structure from a pair of coordinates.



Type to Type conversion routines

The following table lists all routines used to convert a data type to another and back:

Routine Reverse Routine Description

System.Classes.BinToHex

System.Classes.HexToBin

Converts a binary value into its hexadecimal representation and a hexadecimal representation back to binary.

Data.FmtBcd.BCDToCurr

Data.FmtBcd.CurrToBCD

Converts a binary-coded decimal value (BCD) to the corresponding Currency value and back.

Data.FmtBcd.BcdToDouble

Data.FmtBcd.DoubleToBcd

Converts a binary-coded decimal value (BCD) to the corresponding double precision floating point value and back.

Data.FmtBcd.BcdToInteger

Data.FmtBcd.IntegerToBcd

Converts a binary-coded decimal value (BCD) to an integer and back.

System.CompToDouble

System.DoubleToComp

Converts a comp to a double value and back.

To String conversion

The following table lists all routines used to convert a data type into its string representation.

Routine Description

Data.FmtBcd.BcdToStr, Data.FmtBcd.BcdToStrF

Returns a string representation of a binary-coded decimal (BCD) value.

System.SysUtils.BoolToStr

Converts a Boolean value to a string.

System.ConvUtils.ConvUnitToStr

Formats a measurement and its conversion unit into a human-readable string.

System.SysUtils.CurrToStr, System.SysUtils.CurrToStrF, System.SysUtils.FormatCurr

Formats a Currency value as a string.

System.SysUtils.DateTimeToStr, System.SysUtils.DateTimeToString, System.SysUtils.FormatDateTime

Converts a System.TDateTime value to a string.

System.SysUtils.DateToStr

Converts a System.TDate value to a string.

System.SysUtils.FloatToStr, System.SysUtils.FloatToStrF, System.SysUtils.FormatFloat, System.SysUtils.FloatToText, System.SysUtils.FloatToTextFmt

Converts a floating point value to a string.

System.SysUtils.IntToStr, System.SysUtils.IntToHex

Converts a 32 or 64-bit integer to a string.

System.SysUtils.TimeToStr

Converts a System.TDateTime value to a string.

System.SysUtils.UIntToStr

Converts an unsigned 32 or 64-bit integer to a string.

System.Str

Formats a string and returns it to a variable.



From String conversion

The following table lists all routines used to convert a string to a specific data type:

Routine With Def. Value Exception-less variant Description

Data.FmtBcd.StrToBcd

Data.FmtBcd.TryStrToBcd

Converts a string to the corresponding binary-coded decimal (BCD) value.

System.SysUtils.StrToBool

System.SysUtils.StrToBoolDef

System.SysUtils.TryStrToBool

Converts a string to a Boolean value.

System.ConvUtils.StrToConvUnit

System.ConvUtils.TryStrToConvUnit

Parses a string into a value and conversion type.

System.SysUtils.StrToCurr

System.SysUtils.StrToCurrDef

System.SysUtils.TryStrToCurr

Converts a string to a Currency value.

System.SysUtils.StrToDate

System.SysUtils.StrToDateDef

System.SysUtils.TryStrToDate

Converts a string to a System.TDate value.

System.SysUtils.StrToDateTime

System.SysUtils.StrToDateTimeDef

System.SysUtils.TryStrToDateTime

Converts a string to a System.TDateTime value.

System.SysUtils.StrToFloat

System.SysUtils.StrToFloatDef

System.SysUtils.TryStrToFloat

Converts a given string to a floating-point value.

System.SysUtils.StrToInt

System.SysUtils.StrToIntDef

System.SysUtils.TryStrToInt

Converts a string that represents an integer (decimal or hex notation) to a number.

System.SysUtils.StrToInt64

System.SysUtils.StrToInt64Def

System.SysUtils.TryStrToInt64

Converts a string that represents an integer (decimal or hex notation) to a number.

System.SysUtils.StrToTime

System.SysUtils.StrToTimeDef

System.SysUtils.TryStrToTime

Converts a string to a System.TDateTime value.

Data.SqlTimSt.StrToSQLTimeStamp

Converts a string to a Data.SqlTimSt.TSQLTimeStamp value.

System.Val

Converts a string to a numeric representation.

See Also

Code Examples