TCustomAction.AssignTo procedure
Copies property from the class instance to the specified persistent object.
Declaration
procedure AssignTo(Dest: TPersistent); overrideArguments
Dest | Persistent object where property values are stored. |
Description
AssignTo is the generic function to assign the class' contents to
another class. This method must be overridden by descendent classes to
actually assign the content of the source instance to the destination
instance.
The TPersistent implementation of Assignto raises an
EConvertError exception. This is done for the following reason: If
the source class doesn't know how to assign itself to the destination class
(using AssignTo), the destination class may know how get the data
from the source class (using Assign). If
all descendent methods are implemented correctly, then if neither of the two
classes knows how to assign their contents to each other, execution will end
up at Assign, which will simply execute.
Dest.AssignTo(Self);
If neither of the classes knows how to assign to/from each other, then
execution will end up at the TPersistent implementation of
AssignTo, and an exception will be raised.
Errors
Raises an EConvertError exception if the current class cannot be assigned to the persistent class instance in Dest.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
