RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAbstractNamedVariants.Error Method

Raises an ENamedVariantsError exception.

Pascal
procedure Error(const Msg: string; Data: Integer); overload;
C++
__fastcall Error(const AnsiString Msg, int Data);

TAbstractNamedVariants calls Error internally when it encounters an invalid index. For example, if an application tries to delete or change a name/Variant pair and supplies an index that is greater than Count, TAbstractNamedVariants calls Error to generate the exception about the out-of-bounds index. 

Msg is the error message for the exception. This message contains a format specifier for the integer that represents the index that caused the problem. 

Data is the index that caused the problem. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!