RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ConvUtils.RaiseConversionError Function

Raises an EConversionError exception.

Pascal
procedure RaiseConversionError(const AText: string); overload;
procedure RaiseConversionError(const AText: string; const AArgs: array of const); overload;
C++
RaiseConversionError(const AnsiString AText);
RaiseConversionError(const AnsiString AText, const array of const AArgs);

ConvUtils

Call RaiseConversionError to raise an EConversionError exception. Most applications do not need to call this method because most conversion errors are raised by the Convert function.  

However, you might want to raise an EConversionError exception from a method you supply to the RegisterConversionType function for converting between a new conversion type and the base units of a conversion family. For example, if a unit of measurement does not permit negative values, you could check for negative values and call RaiseConversionError if an attempt is made to use one in a conversion. 

AText is the error message for the exception that is raised. It can contain standard string formatting specifiers. 

AArgs is a list of arguments that are supplied for the format specifiers in AText.

Note: In C++, Args_Size is the index of the last argument in AArgs. (One less than the number of elements).
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!