TPSQLDump.TableName: string
property with the TPSQLDump.TableNames: TStrings
. In essence, it is necessary to implement the possibility of dumping several specified tables instead of one.TPSQLDump = class (TComponent)
private
...
procedure ReadTableName (Reader : TReader) ;
protected
procedure DefineProperties (Filer : TFiler) ; override ;
...
published
...
//property TableName: string ...
property TableNames : TStrings read FTableNames
write SetTableNames ;
...
end ; //TPSQLDump
implementation
...
procedure TPSQLDump . DefineProperties (Filer : TFiler) ;
begin
inherited ;
Filer . DefineProperty( 'TableName' , ReadTableName , nil , False ) ;
end ;
procedure TPSQLDump . ReadTableName (Reader : TReader) ;
var S : string ;
begin
S := Reader . ReadString ;
if S > '' then FTableNames . Append(S) ;
end ;
Filer.DefineProperty
) TableName
property in the overlapped DefineProperties
method. The ReadTableName
method will read the values of the TableName
. Since we did not assign a method for writing (we passed nil
second parameter), this property will never be saved in the future. Problem solved.Source: https://habr.com/ru/post/75932/
All Articles