Data.DB.TField.AsString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AsString: string read GetAsString write SetAsString;

C++

__property System::UnicodeString AsString = {read=GetAsString, write=SetAsString};

Properties

Type Visibility Source Unit Parent
property public
Data.DB.pas
Data.DB.hpp
Data.DB TField

Description

Represents the field's value as a string (Delphi) or an AnsiString (C++).

Reading the AsString property returns the abbreviated class name of the field component enclosed in parentheses. The abbreviated class name is built by stripping the leading 'T' from the class name and removing the trailing word 'FIELD', except in the case of TField where that would leave an empty string. Thus, the abbreviated class name of TField is "FIELD", the abbreviated class name of TVarBytesField is "VarBytes", and so on.

Trying to set the AsString property raises an exception.

Descendants of TField that represent string fields or that support conversions between the field's Value property and a string override AsString to read and write the value of the field as a different, more meaningful, string.

See Also

Code Examples