[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# assign(Variant):TCaption

Declares an assignment operator used to convert a Variant type to a TCaption type.

## Declaration

Source position: controls.pp line 2794

`operator operator :=(`
`AVariant: Variant`
`):TCaption;`

## Description

Declares an assignment operator used to convert a TVariant value to a TCaption value during assignment. Casts the value in AVariant to a String type and assigns it as the return value for the operator. For example:

    var
      AVariant: Variant;
      AControl: TControl;
      // ...
      AControl.Caption := AVariant;