RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TParameter.Assign Method

Copies the properties and value of one TParameter object to another.

Pascal
procedure Assign(Source: TPersistent); override;
C++
virtual __fastcall Assign(TPersistent * Source);

Call Assign to make one TParameter an exact clone of another. Assign copies the values of the Attributes, DataType, Direction, Name, NumericScale, Precision, Size, and Value properties from the parameter object specified in Source to the calling parameter object.

ADOStoredProc1.Parameters[0].Assign(ADOStoredProc2.Parameters.Items[0]);

 

ADOStoredProc1->Parameters[0]->Assign(ADOStoredProc2->Parameters.Items[0]);

Assign may be used with various types of sources: another TParameter, a field in a table, a string list object (most often for a memo type parameter), or a TBitmap (for BLOB type fields), a TPicture (for BLOB type fields). In the example below, Assign is used to give a value for a memo type parameter from a string list object (the Lines property of a TMemo).

ADOStoredProc1.Parameters[1].Assign(Memo1.Lines);

 

ADOStoredProc1->Parameters[1]->Assign(Memo1->Lines);

 

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