RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TFieldList.FieldByName Method

Returns a field, given its name.

Pascal
function FieldByName(const Name: string): TField;
C++
__fastcall TField FieldByName(const AnsiString Name);

Call FieldByName to retrieve field information for a field when only the field's name is known. FieldName is the name of an existing field. FieldByName returns the TField component for the specified field. An application can access specific properties and methods of the field directly.  

If the specified field is not found, FieldByName raises an EDatabaseError exception.

Note: FieldByName differs from the Find method only when the named field is not in the list. When the field is not found, FieldByName raises an exception, while Find returns nil (Delphi) or NULL (C++).
 

 

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